﻿var commonFunc = {
    data: function(){
        var self = this;
    },
    serializeToObj: function(val){
        var _obj={},_val=val.split('&');
        for(var i=0,len=_val.length;i<len;i++){
            var _cache = _val[i].split('=');
            _obj[_cache[0]] = _cache[1];
        }
        return _obj;
    },
    ajax_get: function(url, param, back_success, option) {
        var self = this;
        option = option==undefined?{}: option;
        $.ajax({
            type: option.type==undefined?'GET': option.type,
            url: url,
            data: param,
            async: option.async==undefined?true: false,
            dataType: 'json',
            contentType: option.contentType==undefined?'application/json; charset=utf-8': option.contentType,
            success: function(res) {
                back_success(res);
            },
            error: function(XMLHttpRequest, textStatus, errorThrown) {
                if (!option.error) {
                    layer.msg('网络失败，请刷新页面后重试',{time: 1000});
                    return;
                } else {
                    option.error(XMLHttpRequest, textStatus, errorThrown);
                }
            }
        })
    },
    isEmptyObject: function(obj){
        for(var key in obj){
            return false;
        }
        return true;
    },
    arrayMerge: function(arr1, arr2) {
        var tempArr = [];
        for(var i = 0; i < arr1.length; i ++){
            if(!commonFunc.hasOwnObject(tempArr, arr1[i])) {
                tempArr.push(arr1[i])
            }
        }
        for(var j = 0; j < arr2.length; j++) {
            if(!commonFunc.hasOwnObject(tempArr, arr2[j])) {
                tempArr.push(arr2[j])
            }
        }
        return tempArr;
    },
    isObjectValueEqual: function(obj1, obj2) {
        var aProps = Object.getOwnPropertyNames(obj1);
        var bProps = Object.getOwnPropertyNames(obj2);

        if (aProps.length != bProps.length) {
            return false;
        }

        for (var i = 0; i < aProps.length; i++) {
            var propName = aProps[i];
            if (obj1[propName] !== obj2[propName]) {
                return false;
            }
        }
        return true;
    },
    hasOwnObject: function(arr, obj){
        for(var i = 0; i < arr.length; i++) {
            if(commonFunc.isObjectValueEqual(arr[i], obj)){
                return false;
            }
        }
        return true;
    }
}
//渲染案件类型
function add_register(div){
    var copy = $(div).parents('.form_unit_line').siblings('.register_form_content').clone().insertBefore($(div).parents('.form_unit_line')).show()
    copy.find('span.city-picker-span').remove();
    copy.find('div.city-picker-dropdown').remove();
    copy.find('.region_picker_ip ').citypicker();
}
function add_contact(div) {
    var copy = $(div).parents('.form_unit_line').siblings('.contact_form_content').clone().insertBefore($(div).parents('.form_unit_line')).show()
    copy.find('span.city-picker-span').remove();
    copy.find('div.city-picker-dropdown').remove();
    copy.find('.region_picker_ip ').citypicker();

}
function add_transfer_contact(div) {
    
    var copy = $(div).parents('.form_unit_line').siblings('.contact_form_content').clone().insertBefore($(div).parents('.form_unit_line')).show()
    copy.find('span.city-picker-span').remove();
    copy.find('div.city-picker-dropdown').remove();
    copy.find('.region_picker_ip ').citypicker();
}

function removeUploaded () {
    var target = event.target;
    $(target).siblings('a').remove();
    $(target).siblings('input').val('');
    $(target).siblings('label').html('+');
    $(target).remove();
}

$(function () {
    wzERP.Backlog.init();
    demo(0,1);
});
// 获取当前页面内容
function demo(types,curr,num,searchKey,startDate,endDate,startUserId,statusCode) {
    //curr:当前页
    //num:每页显示条数
    //searchKey:搜索内容
    //startDate:开始时间
    //endDate:结束时间
    //startUserId 发起人id
    //处理状态 statusCode
    $.get('/todo/queryByPage',{queryType:types || 0,current:curr || 1,pageSize:num || 10,searchKey:searchKey,startDate:startDate,endDate:endDate,startUserId:startUserId,statusCode:statusCode},function(content){
        if (content.code==9999)
        {
            layer.msg(content.msg,{time: 1000});
            wzERP.Common.TimeoutLogin();
            return false;
        }
        console.info("待办事项内容："+content.data);
        //获取内容显示到模板上
        if(types==0){
            $('#formData').html(template('formTpl',content.data))
            $('.recordOne').text(content.data.total)
            $('.recordTwo').text(content.data.pages)
        }else{
            $('#formData1').html(template('formTpl2',content.data))
            $('#recordOne1').text(content.data.total)
            $('#recordTwo1').text(content.data.pages)
        }
        console.log(content.data)
        permissonHandler();
        if(types==0){
            // 分页 待办事项的
            layui.use(['laypage', 'layer'], function () {
                var laypage = layui.laypage;
                laypage({
                    cont: 'turn-page',
                    curr: curr || 1,
                    pages: content.data.pages,
                    skin: '#457fe6',
                    skip: true,
                    jump:function (obj,first) {
                        var num = $('#numberOf select').val()
                        if(!first){
                            //获取发起人id
                            $.get('/basedata/employee/queryAllEmployee',function(data){
                                if (data.code==9999)
                                {
                                    layer.msg(data.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                                if($('#userId0').val()!=''){
                                    var val
                                    var name=$('#userId0').val()
                                    for(var i=0;i<data.data.length;i++){
                                        if(data.data[i].employeeName==name){
                                            val = data.data[i].id
                                        }
                                    }
                                }else {
                                    var val = null
                                }
                                var timeA = timeS0()
                                //获取当前每页应该显示条数
                                demo(types,obj.curr,num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                            })
                        }
                    }
                });
            });
        }else{
            // 分页 已办事项的
            layui.use(['laypage', 'layer'], function () {
                var laypage = layui.laypage;
                laypage({
                    cont: 'turn-page1',
                    curr: curr || 1,
                    pages: content.data.pages,
                    skin: '#457fe6',
                    skip: true,
                    jump:function (obj,first) {
                        var num = $('#numberOf1 select').val()
                        if(!first){
                            //获取发起人id
                            $.get('/basedata/employee/queryAllEmployee',function(data){
                                if (data.code==9999)
                                {
                                    layer.msg(data.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                                if($('#userId1').val()!=''){
                                    var val
                                    var name=$('#userId1').val()
                                    for(var i=0;i<data.data.length;i++){
                                        if(data.data[i].employeeName==name){
                                            val = data.data[i].id
                                        }
                                    }
                                }else {
                                    var val = null
                                }
                                var timeA = timeS1()
                                //获取当前每页应该显示条数
                                demo(types,obj.curr,num,timeA.searchKey,timeA.startDate,timeA.endDate,val,null);
                            })
                            //demo(types,curr,num);
                        }
                    }
                });
            });
        }
    })
}

// 待办事项每页显示条数
$('#numberOf').on('click',function(){
    var types = $('#main > .ui.tabular.menu .item.active').data('type');
    //获取当前页数
    var page =$('.ui.tab.active .layui-laypage-skip').val()
    console.info("待办事项：获取当前页数"+page);
    // 获取表单时间
    var content = $("#searchForm").serialize()
    //使用方法分割取出
    var contentS =content.split('&')
    var obj = {}
    for(var i = 0;i<contentS.length;i++){
        var con = contentS[i].toString()
        var son = con.split('=')
        obj[son[0]]=son[1]
    }
    //获取当前每页应该显示条数
    var num = $('#numberOf select').val()
    //获取搜索框内容
    var searchKey = $('#searchKeyA').val()
    //获取分割好的起止时间
    var startDate = obj.startDate
    var endDate = obj.endDate;
    //处理状态
    var statusCode = obj.statusCode;
    //获取发起人id
    var val;
    $.get('/basedata/employee/queryAllEmployee',function(data){
        if (data.code==9999)
        {
            layer.msg(data.msg,{time: 1000});
            wzERP.Common.TimeoutLogin();
            return false;
        }
        if($('#userId0').val()!=''){
            var name=$('#userId0').val()
            for(var i=0;i<data.data.length;i++){
                if(data.data[i].employeeName==name){
                    val = data.data[i].id
                }
            }
        }else {
            val = null
        }
    })
    demo(types,page,num,searchKey,startDate,endDate,val,statusCode);
})

// 已办事项每页显示条数
$('#numberOf1').on('click',function(){
    var types = $('#main > .ui.tabular.menu .item.active').data('type');
    //获取当前页数
    var page =$('.ui.tab.active .layui-laypage-skip').val()
    console.info("已办事项：获取当前页数"+page);
    // 获取表单时间
    var content = $("#searchForm1").serialize()
    //使用方法分割取出
    var contentS =content.split('&')
    var obj = {}
    for(var i = 0;i<contentS.length;i++){
        var con = contentS[i].toString()
        var son = con.split('=')
        obj[son[0]]=son[1]
    }
    //获取当前每页应该显示条数
    var num = $('#numberOf1 select').val()
    //获取搜索框内容
    var searchKey = $('#searchKeyA').val()
    //获取分割好的起止时间
    var startDate = obj.startDate
    var endDate = obj.endDate
    //获取发起人id
    var val
    $.get('/basedata/employee/queryAllEmployee',function(data){
        if (data.code==9999)
        {
            layer.msg(data.msg,{time: 1000});
            wzERP.Common.TimeoutLogin();
            return false;
        }
        if($('#userId0').val()!=''){
            var name=$('#userId0').val()
            for(var i=0;i<data.data.length;i++){
                if(data.data[i].employeeName==name){
                    val = data.data[i].id
                }
            }
        }else {
             val = null
        }
    })
    demo(types,page,num,searchKey,startDate,endDate,val,null);
})
//全局点击事件节流
var throttle = true
//待办事项查询
$("#timeA").on('click',function(){
    var types = $('#main > .ui.tabular.menu .item.active').data('type');
    // 获取表单时间
    var content = $("#searchForm").serialize();
    if(types==0){
        content = $("#searchForm").serialize();
    }else if(types==1){
        content = $("#searchForm1").serialize();
    }
    //使用方法分割取出
    var contentS =content.split('&')
    var obj = {}
    for(var i = 0;i<contentS.length;i++){
        var con = contentS[i].toString()
        var son = con.split('=')
        obj[son[0]]=son[1]
    }
    //获取当前每页应该显示条数
    var num = $('#numberOf select').val();
    //获取搜索框内容
    var searchKey = $('#searchKeyA').val();
    //获取分割好的起止时间
    console.info("待办事项的参数"+obj+"tab类型"+types);
    var startDate = obj.startDate;
    var endDate = obj.endDate;
   // var initiatorId = obj.startUserId;//发起人id
    //获取搜索内容
    var statusCode = obj.statusCode;//待办事项状态 数据词典的code
    //获取发起人id
    var val
    $.get('/basedata/employee/queryAllEmployee',function(data){
        if (data.code==9999)
        {
            layer.msg(data.msg,{time: 1000});
            wzERP.Common.TimeoutLogin();
            return false;
        }
        if($('#userId0').val()!=''){
            var name=$('#userId0').val()
            for(var i=0;i<data.data.length;i++){
                if(data.data[i].employeeName==name){
                    val = data.data[i].id
                }
            }
        }else {
             val = null
        }
        query(types,1,num,searchKey,startDate,endDate,val,statusCode);
    })
    function query(types,curr,num,searchKey,startDate,endDate,val,statusCode){
        $.get('/todo/queryByPage',{queryType:types || 0, current:curr || 1,pageSize:num || 10,searchKey:searchKey,startDate:startDate,endDate:endDate,startUserId:val,statusCode:statusCode},function(content){
            if (content.code==9999)
            {
                layer.msg(content.msg,{time: 1000});
                wzERP.Common.TimeoutLogin();
                return false;
            }
            //获取内容显示到模板上
            $('#formData').html(template('formTpl',content.data));
            $('.recordOne').text(content.data.total);
            $('.recordTwo').text(content.data.pages);
            // 分页
            layui.use(['laypage', 'layer'], function () {
                var laypage = layui.laypage;
                laypage({
                    cont: 'turn-page',
                    curr: curr || 1,
                    pages: content.data.pages,
                    skin: '#457fe6',
                    skip: true,
                    jump:function (obj,first) {
                        var num = $('#numberOf select').val();
                        if(!first){
                            query(types,obj.curr,num,searchKey,startDate,endDate);
                        }
                    }
                });
            });
        })
    }
    return false
})

//已办事项查询
$("#timeA1").on('click',function(){
    var types = $('#main > .ui.tabular.menu .item.active').data('type');
    // 获取表单时间
    var content = $("#searchForm1").serialize();
    //使用方法分割取出
    var contentS =content.split('&')
    var obj = {}
    for(var i = 0;i<contentS.length;i++){
        var con = contentS[i].toString()
        var son = con.split('=')
        obj[son[0]]=son[1]
    }
    //获取当前每页应该显示条数
    var num = $('#numberOf1 select').val()
    //获取搜索框内容
    var searchKey = $('#searchKeyA1').val()
    //获取分割好的起止时间
    console.info("已办事项的参数"+obj);
    console.info("tab类型"+types);
    var startDate = obj.startDate;
    var endDate = obj.endDate;
    var initiatorId = obj.startUserId;//发起人id
    console.info(obj);
    //获取搜索内容
    //获取发起人id
    var val
    $.get('/basedata/employee/queryAllEmployee',function(data){
        if (data.code==9999)
        {
            layer.msg(data.msg,{time: 1000});
            wzERP.Common.TimeoutLogin();
            return false;
        }
        if($('#userId1').val()!=''){
            var name=$('#userId1').val()
            for(var i=0;i<data.data.length;i++){
                if(data.data[i].employeeName==name){
                    val = data.data[i].id
                }
            }
        }else {
            val = null
        }
        query1(types,1,num,searchKey,startDate,endDate,val)
    })
    function query1(types,curr,num,searchKey,startDate,endDate){
        $.get('/todo/queryByPage',{queryType:types || 0, current:curr || 1,pageSize:num || 10,searchKey:searchKey,startDate:startDate,endDate:endDate,startUserId:val},function(content){
            if (content.code==9999)
            {
                layer.msg(content.msg,{time: 1000});
                wzERP.Common.TimeoutLogin();
                return false;
            }
            //获取内容显示到模板上
            $('#formData1').html(template('formTpl2',content.data))
            $('#recordOne1').text(content.data.total)
            $('#recordTwo1').text(content.data.pages)
            // 分页
            layui.use(['laypage', 'layer'], function () {
                var laypage = layui.laypage;
                laypage({
                    cont: 'turn-page1',
                    curr: curr || 1,
                    pages: content.data.pages,
                    skin: '#457fe6',
                    skip: true,
                    jump:function (obj,first) {
                        var num = $('#numberOf1 select').val()
                        if(!first){
                            query1(types,obj.curr,num,searchKey,startDate,endDate);
                        }
                    }
                });
            });
        })
    }
    return false
})

//获取时间和内容方法和当前页，每页显示条数，客户ID 待办事项0
function timeS0() {
    var timeA={}
    // 获取表单时间
    var content = $("#searchForm").serialize()
    //使用方法分割取出
    var contentS =content.split('&')
    var obj = {}
    for(var i = 0;i<contentS.length;i++){
        var con = contentS[i].toString()
        var son = con.split('=')
        obj[son[0]]=son[1]
    }
    //获取当前每页应该显示条数
    timeA.num = $('#filingLinenumberOf select').val()
    //获取搜索框内容
    timeA.searchKey = $('#filingSearchKeyA').val()
    //获取分割好的起止时间
    timeA.startDate = obj.startDate
    timeA.endDate = obj.endDate
    timeA.statusCode = obj.statusCode;//处理状态
    //当前页
    timeA.page =$('.ui.tab.active .layui-laypage-skip').val()
    return timeA
}

//获取时间和内容方法和当前页，每页显示条数，客户ID 已办事项0
function timeS1() {
    var timeA={}
    // 获取表单时间
    var content = $("#searchForm1").serialize()
    //使用方法分割取出
    var contentS =content.split('&')
    var obj = {}
    for(var i = 0;i<contentS.length;i++){
        var con = contentS[i].toString()
        var son = con.split('=')
        obj[son[0]]=son[1]
    }
    //获取当前每页应该显示条数
    timeA.num = $('#filingLinenumberOf1 select').val()
    //获取搜索框内容
    timeA.searchKey = $('#filingSearchKeyA1').val()
    //获取分割好的起止时间
    timeA.startDate = obj.startDate
    timeA.endDate = obj.endDate
    //当前页
    //获取当前页数
    timeA.page =$('.ui.tab.active .layui-laypage-skip').val()
    return timeA
}

wzERP.Backlog.init = function () {
    //初始化时间控件
    wzERP.Common.inlineDate('#rangestart', '#rangeend');
    wzERP.Common.inlineDate('#rangestart1', '#rangeend1');
};
//获取日志备注方法
template.defaults.imports.remarksA=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.mark
}
//获取资料收集方法
template.defaults.imports.analysis=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.pathName
}
//操作日志回退原因回显
template.defaults.imports.rollBackReason=function(content){
    var tt = content.replace('\t','\\\\t')
    var dataContent = JSON.parse(tt)
    return dataContent.reason
}
// 商品服务显示
template.defaults.imports.formatInternationDetail=function(content){
    content = JSON.parse(content)
    var temp = '';
    for(var i = 0; i< content.length; i++) {
        temp += content[i].midtypeid + '-' + content[i].smalltypeid + '-' + content[i].smalltypename;
    }
    return temp;
}
//获取是否纸制方法
template.defaults.imports.paper=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    if(dateCantent.isPaperReport==1){
        return '是'
    }else {
        return '否'
    }
}
//是否寄送快递方法
template.defaults.imports.express=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    if(dateCantent.isPosted==1){
        return '已寄送'
    }else {
        return '未寄送'
    }
}
//获取通知书编号方法
template.defaults.imports.number=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.noticeCode
}
//获取通知书编号方法
template.defaults.imports.getApplyUrl=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.applyUrl
}
//获取通知书编号方法
template.defaults.imports.getNoticeUrl=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.noticeUrl
}
//获取商标申请号方法
template.defaults.imports.application=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.trademarkCode
}
//获取快递公司方法
template.defaults.imports.company=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.postName
}
//获取快递单号方法
template.defaults.imports.oddNumbers=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.postCode
}
//获取查询分析方法
template.defaults.imports.collect=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.noticeUrl
}
//时间过滤方法
template.defaults.imports.dateTimes=function(now){
    if(now==null){
        return ''
    }
    function add0(m){return m<10?'0'+m:m }
    var time = new Date(now);
    var y = time.getFullYear();
    var m = time.getMonth()+1;
    var d = time.getDate();
    var h = time.getHours();
    var mm = time.getMinutes();
    var s = time.getSeconds();
    return y+'-'+add0(m)+'-'+add0(d)+' '+add0(h)+':'+add0(mm)+':'+add0(s);
}
//处理数据方法
template.defaults.imports.dateCantent=function(cantent){
    var dateCantent = JSON.parse(cantent)
    var content=[]
    var contents
    for (var i=0;i<dateCantent.length;i++){
        contents = dateCantent[i].id+'-'+dateCantent[i].name
        content.push(contents)
    }
    return content.join(';')
}
//处理图片缓存问题
template.defaults.imports.remarksData=function(cantent){
    var data = Date.parse(new Date())
    return  cantent +'&'+ data

}
//判断申请书文件是否上传
template.defaults.imports.upload=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    if(dateCantent.noticeUrl==null||dateCantent.noticeUrl==''){
        return '未上传'
    }else {
        return '查看详细'
    }
}
//获取指派接案人方法
template.defaults.imports.appoint=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.nextHandlerName
}
//获取商标查询分析
template.defaults.imports.trademarkInquiry=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.queryFileUrl
}
//判断商标查询分析是否有值
template.defaults.imports.trademarkJudgment=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    if(dateCantent.queryFileUrl==null||dateCantent.queryFileUrl==''){
        return '未上传'
    }else {
        return '查看详细'
    }
}
//判断商标查询分析是否有值并切换显示
template.defaults.imports.checkDisplay=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    if(dateCantent.queryFileUrl==null||dateCantent.queryFileUrl==''){
        return 'display:none;'
    }else {
        return 'display:inline-block;'
    }
}
//判断商标查询分析是否有值并切换显示
template.defaults.imports.checkDisplayOther=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    if(dateCantent.noticeUrl==null||dateCantent.noticeUrl==''){
        return 'display:none;'
    }else {
        return 'display:inline-block;'
    }
}
//处理审批结果方法
template.defaults.imports.approvalResult=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.pathName

}
//获取日志备注方法
template.defaults.imports.remarksS=function(cantent){
    var tt = cantent.replace('\t','\\\\t')
    var dateCantent = JSON.parse(tt)
    return dateCantent.mark

}


//查看事项
$('#formData1').on('click','.viewButton',function(){
    var id = $(this).attr('data-id')
    var type =$(this).attr('data-content')
    //案件
    if(type==1){
        $('#trademarkToModal').modal({
            closable: false,
            transition: 'fade'
        }).modal('show')
        $.get('/trademark/case/queryDetail',{id:id},function(data){
            if (data.code==9999)
            {
                layer.msg(data.msg,{time: 1000});
                wzERP.Common.TimeoutLogin();
                return false;
            }
            if(data.code!=0){
                layer.msg(data.msg, {icon: 5})
            }
            //渲染图片
            $('#trademarkRightPictureImg').html(template('trademarkImgTemplate',data.data))
            //渲染客户
            $('#trademarkCustomerDetails').html(template('customerInformation',data.data))
            //渲染案件
            //商标立案
            if(data.data.trademarkRegist!=null){
                $('#trademarkCaseDetailsPlacement').html(template('trademarkRegistrationTemplate',data.data.trademarkRegist))
                //商标转让
            }else if(data.data.trademarkTransfer!=null){
                $('#trademarkCaseDetailsPlacement').html(template('trademarkTransferTemplate',data.data.trademarkTransfer))
                //商标变更
            }else if(data.data.trademarkChange!=null){
                $('#trademarkCaseDetailsPlacement').html(template('changeOfTrademarkTemplate',data.data.trademarkChange))
                //商标续展
            }else if(data.data.trademarkExtend!=null){
                $('#trademarkCaseDetailsPlacement').html(template('renewalOfTrademarkTemplate',data.data.trademarkExtend))
                //商标许可
            }else if(data.data.trademarkLicens!=null){
                $('#trademarkCaseDetailsPlacement').html(template('trademarkLicensingTemplate',data.data.trademarkLicens))
                //商标补证
            }else if(data.data.trademarkCertificate!=null){
                $('#trademarkCaseDetailsPlacement').html(template('trademarkSupplementTemplate',data.data.trademarkCertificate))
            }
            //渲染操作日志
            $('#trademarkRightPicture').html(template('logDetailsTemplate',data.data))
        })
        //立案
    }else if(type==0){
        $('#filingToModal').modal({
            closable: false,
            transition: 'fade'
        }).modal('show')
        $.get('/filing/manage/filingDetail',{id:id},function(data){
            if (data.code==9999)
            {
                layer.msg(data.msg,{time: 1000});
                wzERP.Common.TimeoutLogin();
                return false;
            }
            if(data.code==-1){
                layer.msg(data.msg, {icon: 5})
                return false
            }
            //立案信息
            $('#filingPlacementArea').html(template('filingDetailsTemplate',data.data))
            //操作日志
            $('#filingRightPicture').html(template('filingRightPictureTemplate',data.data))
            //流程图
            $('#filingRightPictureImg').html(template('filingImgTemplate',data.data))
        })
    }
})
//办理事项
$('#formData').on('click','.handling',function(){
    var id = $(this).attr('data-id')
    var type =$(this).attr('data-content')
    //立案
    if(type==0){
        //清理遗留备注
        $('.filingTextarea').val('')
        $('#ToExamineModal').modal({
            closable: false,
            transition: 'fade'
        }).modal('show')
        //渲染详情
        $('.AuditButton').attr('data-id',id)
        $.get('/filing/manage/filingDetail',{id:id},function(data){
            if (data.code==9999)
            {
                layer.msg(data.msg,{time: 1000});
                wzERP.Common.TimeoutLogin();
                return false;
            }
            if(data.code==-1){
                layer.msg(data.msg, {icon: 5})
                return false
            }
            $('.filingAuditDetailsTop').html(template('filingDetailsTemplate',data.data))
            $('.filingAuditDetailsLower').html(template('filingRightPictureTemplate',data.data))
            $('.filingAuditPicture').html(template('filingImgTemplate',data.data))
            $.get('/filing/manage/nextNodeInfo',{id:id},function(data){
                $('.filingAuditButtonContent').html(template('filingAuditButtonTemplate',data.data))
            })
        })
        //提交办理
        $('.AuditButton').off().on('click',function () {
            //判断点击事件的次数
            if(!throttle){
                return false
            }
            if($('.filingAuditButtonContent').val()==''||$('.filingAuditButtonContent').val()==null){
                layer.msg('请选择审批人', {icon: 5})
                return false
            }
            var id = $(this).attr('data-id')
            var activityId=$('.filingAuditButtonContent').val()
            var pathName=$('.filingAuditButtonContent').find("option:selected").text()
            var mark=$('.filingTextarea').val()
            //防止事件点击2次
            throttle = false
            window.setTimeout(function () {
                throttle = true
            },2000)
            NetUtis.doPostBodySimple("/filing/manage/approve", {id:id,activityId:activityId,pathName:pathName,mark:mark},function(data){
                    if(data.code==0){
                        layer.msg('提交成功', {icon: 7})
                        $('#ToExamineModal').modal('hide')
                        //获取发起人id
                        var val
                        $.get('/basedata/employee/queryAllEmployee',function(data){
                            if($('#userId0').val()!=''){
                                var name=$('#userId0').val()
                                for(var i=0;i<data.data.length;i++){
                                    if(data.data[i].employeeName==name){
                                        val = data.data[i].id
                                    }
                                }
                            }else {
                                val = null
                            }
                            var timeA = timeS0()
                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                        })
                    }
                    else if (data.code==9999)
                    {
                        layer.msg(data.msg,{time: 1000});
                        wzERP.Common.TimeoutLogin();
                        return false;
                    }
                    else{
                        layer.msg(data.msg, {icon: 7})
                    }
                },
                true,true)
        })
    //案件办理
    }else if(type==1){
        //清理分案的遗留备注
        $('.divisionNote').val('')
        // 显示办理模态框
        $('#filingToExamineModal').modal({
            closable: false,
            transition: 'fade'
        }).modal('show')
        // 获取案件ID
        var id = $(this).attr('data-id')
        $('.filingAuditButton').attr('data-id',id)
        $('.filingSaveButton').attr('data-id',id)

        //渲染页面详情
        $.get('/trademark/case/queryDetail',{id:id},function(data){
            // 日志相关变量
            var saveLog = data.data.saveLog;
            var saveLogId;
            var saveLogJson;

            if (data.code==9999)
            {
                layer.msg(data.msg,{time: 1000});
                wzERP.Common.TimeoutLogin();
                return false;
            }
            console.log(data)
            // 获取当前是哪个流程节点
            var flowTypeId;
            if(data.data) {
                flowTypeId = data.data.caseInfo.flowTypeId;
            }
            $('#customerContent').html(template('customerInformation',data.data))
            $('#filingAuditDetailsLower').html(template('logDetailsTemplate',data.data))
            $('#filingAuditPicture').html(template('trademarkImgTemplate',data.data))

            console.log('flowTypeId:' + flowTypeId);

            // 判断当前编辑模板并初始化显示
            if(flowTypeId == 'trademark_regist'){
                $('#caseContent').html(template('trademark_regist', data.data));
                var trademarkRegist = data.data.trademarkRegist;
                //初始化城市控件数据
                $(".trademark_regist_form .region_picker_ip").citypicker({
                    province: trademarkRegist.provinceName,
                    city: trademarkRegist.cityName,
                    district: trademarkRegist.countyName,
                });
                case_page.city_picker_form_data_set();
                // 国际分类检索
                $("#caseContent").on('keyup','.classify_ip',function(){
                    var _searchKey = $(this).val();
                    case_page.brand_check_func(_searchKey,1,$(this));
                });
                // 商标详情初始化显示
                $(".description").val(trademarkRegist.description);

                //商品/服务初始化显示
                var internationDetail = trademarkRegist.internationDetail;
                var dataContent = JSON.parse(internationDetail)
                var result = '';
                var readOnly = '';
                for (var i = 0; i < dataContent.length; i++) {
                    result += '<span class="sv_btn_unit" id="sv_btn_un' + dataContent[i].midtypeid + '_' + dataContent[i].smalltypeid
                        + '" data-bigtypeid="' + dataContent[i].bigtypeid + '" data-bigtypename="' + dataContent[i].bigtypename
                        + '" data-midtypeid="' + dataContent[i].midtypeid + '" data-midtypename="' + dataContent[i].midtypename
                        + '" data-smalltypeid="' + dataContent[i].smalltypeid + '" data-smalltypename="' + dataContent[i].smalltypename
                        + '"><span>'
                        + dataContent[i].midtypeid + '</span>-<span>' + dataContent[i].smalltypeid +'</span>-<span class="smalltypename">' + dataContent[i].smalltypename
                        +'</span></span>';
                }
                for (var i = 0; i < dataContent.length; i++) {
                    readOnly += '<span id="sv_btn_un' + dataContent[i].midtypeid + '_' + dataContent[i].smalltypeid
                        + '" data-bigtypeid="' + dataContent[i].bigtypeid + '" data-bigtypename="' + dataContent[i].bigtypename
                        + '" data-midtypeid="' + dataContent[i].midtypeid + '" data-midtypename="' + dataContent[i].midtypename
                        + '" data-smalltypeid="' + dataContent[i].smalltypeid + '" data-smalltypename="' + dataContent[i].smalltypename
                        + '"><span>'
                        + dataContent[i].midtypeid + '</span>-<span>' + dataContent[i].smalltypeid +'</span>-<span class="smalltypename">' + dataContent[i].smalltypename
                        +'</span></span>';
                }
                $('<div class="sv_unit_readOnly">').append(readOnly).insertAfter('.sv_btn_add_btn');
                $(result).insertAfter('.sv_btn_add_btn');
                $('#caseContent').on('click', '.sv_btn_unit', function(){
                    $(this).remove();
                })
                // 申请人类型切换
                $("input[name=proposerType]").change(function(){
                    if($(this).val() == "1") {
                        $('#legalIdcardInputGroup').show();
                    } else {
                        $('#legalIdcardInputGroup').hide();
                    }
                });
                //添加商品/服务
                $('.case_unit').on('click','.sv_btn_add_btn',function(){
                    var _Pid = $(this).parents('.form_unit_line').prev().find('.classify_store').val();
                    if(_Pid == ''){
                        layer.msg('请选择国际分类',{time: 1000});
                        return;
                    }
                    $('#goods_sv_selc_dlg').modal({
                        closable: false,
                        transition: 'fade',
                        allowMultiple: true,
                        onHidden: function(){
                            $('#goods_sv_selc_dlg .bdlv3_srh_ip').val('');
                            $('#goods_sv_selc_dlg .sv_type_cont_left').html('');
                            $('#goods_sv_selc_dlg .sv_type_cont_right').html('');
                        },
                    }).modal('show');
                    self.brand_lv3_obj = {};
                    var _this = $(this)
                    _this.siblings('.sv_btn_unit').each(function(index, value){
                        var bigtypeid = $(this).attr('data-bigtypeid');
                        var bigtypename = $(this).attr('data-bigtypename');
                        var midtypeid = $(this).attr('data-midtypeid');
                        var midtypename = $(this).attr('data-midtypename');
                        var smalltypeid = $(this).attr('data-smalltypeid');
                        var smalltypename = $(this).attr('data-smalltypename');
                        if(self.brand_lv3_obj[midtypeid]!=undefined) {
                            self.brand_lv3_obj[midtypeid].push({
                                bigtypeid: bigtypeid,
                                bigtypename: bigtypename,
                                midtypeid: midtypeid,
                                midtypename: midtypename,
                                smalltypeid: smalltypeid,
                                smalltypename: smalltypename,
                            });
                        } else {
                            self.brand_lv3_obj[midtypeid] = [];
                            self.brand_lv3_obj[midtypeid].push({
                                bigtypeid: bigtypeid,
                                bigtypename: bigtypename,
                                midtypeid: midtypeid,
                                midtypename: midtypename,
                                smalltypeid: smalltypeid,
                                smalltypename: smalltypename,
                            });
                        }
                    });
                    case_page.brand_lv3Dlg_evbind(_this);
                    $('#goods_sv_selc_dlg .brand_lv3_classify').click();
                })
            } else if (flowTypeId == 'trademark_certificate') {
                $('#caseContent').html(template('trademark_certificate', data.data));
                $('#caseContent textarea[name=causeDescript]').val(data.data.trademarkCertificate.causeDescript);
                // 国际分类检索
                $("#caseContent").on('keyup','.classify_ip',function(){
                    var _searchKey = $(this).val();
                    case_page.brand_check_func(_searchKey,1,$(this));
                });
            } else if (flowTypeId == 'trademark_transfer') {
                $('#caseContent').html(template('trademark_transfer', data.data));
                var trademarkTransfer = data.data.trademarkTransfer;
                case_page.city_picker_form_data_set();
                for (var i=0; i< trademarkTransfer.contactList.length; i++) {
                    $('.trademark_transfer_form_child').eq(i).find('input[name=address]').siblings('section').find('.region_picker_ip').citypicker({
                        province: trademarkTransfer.contactList[i].provinceName,
                        city: trademarkTransfer.contactList[i].cityName,
                        district: trademarkTransfer.contactList[i].countyName,
                    });
                }
                case_page.city_picker_form_data_set();

                // 国际分类检索
                $("#caseContent").on('keyup','.classify_ip',function(){
                    var _searchKey = $(this).val();
                    case_page.brand_check_func(_searchKey,1,$(this));
                });
            } else if (flowTypeId == 'trademark_change') {
                $('#caseContent').html(template('trademark_change', data.data));
                case_page.city_picker_form_data_set();

                var trademarkChange = data.data.trademarkChange;
                if (trademarkChange.registerList.length>0) {
                    for (var i=0; i< trademarkChange.registerList.length; i++) {
                        $('.trademark_change_form_child ').eq(i).find('input[name=addressPre]').siblings('section').find('.region_picker_ip').citypicker({
                            province: trademarkChange.registerList[i].provinceNamePre,
                            city: trademarkChange.registerList[i].cityNamePre,
                            district: trademarkChange.registerList[i].countyNamePre,
                        });
                        $('.trademark_change_form_child ').eq(i).find('input[name=addressAfter]').siblings('section').find('.region_picker_ip').citypicker({
                            province: trademarkChange.registerList[i].provinceNameAfter,
                            city: trademarkChange.registerList[i].cityNameAfter,
                            district: trademarkChange.registerList[i].countyNameAfter,
                        });
                    }
                } else if (data.data.trademarkChange.proxyer) {
                    $('.trademark_change_form_child.proxyer_form').find('input[name=addressPre]').siblings('section').find('.region_picker_ip').citypicker({
                        province: data.data.trademarkChange.proxyer.provinceNamePre,
                        city: data.data.trademarkChange.proxyer.cityNamePre,
                        district: data.data.trademarkChange.proxyer.countyNamePre,
                    });
                    $('.trademark_change_form_child.proxyer_form').find('input[name=addressAfter]').siblings('section').find('.region_picker_ip').citypicker({
                        province: data.data.trademarkChange.proxyer.provinceNameAfter,
                        city: data.data.trademarkChange.proxyer.cityNameAfter,
                        district: data.data.trademarkChange.proxyer.countyNameAfter,
                    });
                }
                // 国际分类检索
                $("#caseContent").on('keyup','.classify_ip',function(){
                    var _searchKey = $(this).val();
                    case_page.brand_check_func(_searchKey,1,$(this));
                });
                if (data.data.trademarkChange.changeType == 0) {
                    $('#caseContent .register_form').show();
                    $('#caseContent .proxyer_form').hide();
                    $('#caseContent .licensor_form').hide();
                    $(".region_picker_ip").citypicker();
                } else if (data.data.trademarkChange.changeType == 1) {
                    $('#caseContent .proxyer_form').show();
                    $('#caseContent .register_form').hide();
                    $('#caseContent .licensor_form').hide();
                    $(".region_picker_ip").citypicker();
                } else if (data.data.trademarkChange.changeType == 2) {
                    $('#caseContent .licensor_form').show();
                    $('#caseContent .register_form').hide();
                    $('#caseContent .proxyer_form').hide();
                    $(".region_picker_ip").citypicker();
                }
                $('.change_brand_type').change(function(){
                    if($('.change_brand_type').val() == '0') {
                        $('#caseContent .register_form').show();
                        $('#caseContent .proxyer_form').hide();
                        $('#caseContent .licensor_form').hide();
                        $(".region_picker_ip").citypicker();
                    } else if($('.change_brand_type').val() == '1') {
                        $('#caseContent .proxyer_form').show();
                        $('#caseContent .register_form').hide();
                        $('#caseContent .licensor_form').hide();
                        $(".region_picker_ip").citypicker();
                    } else if($('.change_brand_type').val() == '2') {
                        $('#caseContent .licensor_form').show();
                        $('#caseContent .register_form').hide();
                        $('#caseContent .proxyer_form').hide();
                        $(".region_picker_ip").citypicker();
                    }
                });
            } else if (flowTypeId == 'trademark_extend') {
                $('#caseContent').html(template('trademark_extend', data.data));
                // 国际分类检索
                $("#caseContent").on('keyup','.classify_ip',function(){
                    var _searchKey = $(this).val();
                    case_page.brand_check_func(_searchKey,1,$(this));
                });
            } else if (flowTypeId == 'trademark_licence') {
                $('#caseContent').html(template('trademark_licence', data.data));
                if(data && data.data.trademarkLicens) {
                    if (data.data.trademarkLicens.provinceName && data.data.trademarkLicens.cityName && data.data.trademarkLicens.countyName) {
                        $(".region_picker_ip").citypicker({
                            province: data.data.trademarkLicens.provinceName,
                            city: data.data.trademarkLicens.cityName,
                            district: data.data.trademarkLicens.countyName,
                        });
                    } else {
                        $(".region_picker_ip").citypicker();
                    }

                } else {
                    $(".region_picker_ip").citypicker();
                }

                case_page.city_picker_form_data_set();
                // 国际分类检索
                $("#caseContent").on('keyup','.classify_ip',function(){
                    var _searchKey = $(this).val();
                    case_page.brand_check_func(_searchKey,1,$(this));
                });
            }
            var flowTypeId=data.data.caseInfo.flowTypeId

            // 获取当前节点
            $.get('/flow/trademark/currentNodeInfo',{id:id},function(data){
                if (data.code==9999)
                {
                    layer.msg(data.msg,{time: 1000});
                    wzERP.Common.TimeoutLogin();
                    return false;
                }
                var editable = 0;
                // 判断当前节点是否可编辑并保存到输入框
                if (data.data) {
                    editable = data.data.editable;
                }
                $('input[name=editable]').val(editable);

                //指派接案人
                if(data.msg=='还没有创建流程'){
                    //分案节点不显示保存按钮
                    $('.filingSaveButton').hide();
                    //关闭点击事件
                    $('#caseContent input').attr('disabled', 'disabled');
                    $('.city-picker-dropdown').remove();
                    $('#caseContent .add_register').hide();
                    $('#caseContent .add_contact').hide();
                    $('.pdf_no_link').remove();
                    $('#caseContent #powerAttorneyDiv label').click(function(){
                        return false;
                    })
                    $('#caseContent #trademarkDiv label').click(function(){
                        return false;
                    })
                    $('#caseContent #powerAttorneyDiv').hide();
                    $('#caseContent #trademarkUrlDiv label').click(function(){
                        return false;
                    })
                    $('#caseContent #confirmApplyDiv label').click(function(){
                        return false;
                    })
                    $('#caseContent #riskNoticeDiv label').click(function(){
                        return false;
                    })

                    $('#caseContent .sv_btn_add_btn').click(function(){
                        return false;
                    });
                    $('#caseContent .description').attr("disabled",true);
                    $('.sv_btn_add_btn').hide();
                    $('.sv_btn_unit').hide();
                    $('.sv_unit_readOnly').show();
                    $('.sv_btn_unit').off().click(function(){
                        return false;
                    }).removeClass('sv_btn_unit').css({
                        'border': '1px solid #f2711c',
                        'height': '30px',
                        'margin': '5px 5px 5px 0',
                        'padding': '0 5px',
                        'border-radius': '3px',
                        'line-height': '30px',
                    });

                    //渲染指派接案人列表
                    $.get('/flow/trademark/queryNextHandlerList',{},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        console.log(data)
                        var options = '<option value="">请选择</option>'
                        var len = data.data.length;
                        for(var i=0;i<len;i++){
                            options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                        }
                        $('#kDivisionTemplate').html(options);
                    })
                    //资料确认提交
                    $('.filingAuditButton').off().on('click',function(){
                        //判断点击事件的次数
                        if(!throttle){
                            return false
                        }
                        throttle = false
                        window.setTimeout(function () {
                            throttle = true
                        },2000)

                        //案件ID
                        var chk_value =[];
                        chk_value.push($(this).attr('data-id'));
                        //获取员工key
                        var nextHandler=$('#kDivisionTemplate').val()
                        if(case_page.isEmpty(nextHandler)) {
                            $('#kDivisionTemplate').addClass('red-border').focus().click(function(){
                                $(this).removeClass('red-border');
                            });
                            layer.msg('请选择下一处理人', {icon: 5})
                            return false;
                        }
                        //获取员工名字
                        var nextHandlerName = $('#kDivisionTemplate').find("option:selected").text()
                        //获取备注
                        var mark=$('.divisionNote').val()
                        NetUtis.doPostBodySimple("/flow/trademark/dispatchCases", {caseIds:chk_value,nextHandler:nextHandler,mark:mark,nextHandlerName:nextHandlerName},function(data){
                                if(data.code==0){
                                    $('#filingToExamineModal').modal('hide');
                                    layer.msg('提交成功', {icon: 7})
                                    //获取发起人id
                                    var val
                                    $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })
                                }
                                else if (data.code==9999)
                                {
                                    layer.msg(data.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                                else {
                                    layer.msg('提交失败', {icon: 5})
                                }
                            },
                            true,true)
                    })
                    return false
                }

                //资料收集节点
                if(data.data.formId=='node_receive'){
                    console.log('资料收集节点')
                    //判断是不是注册商标
                    if(flowTypeId=='trademark_regist'){
                        var activityId='brandCheck'
                        var pathName='已接案'
                        var roleCode = 'tmA005'
                    }else {
                        var activityId='dataConf'
                        var pathName='已接案'
                        var roleCode = 'tmA006'
                    }

                    //激活表单编辑功能
                    if (editable == 1) {
                        $('*').removeAttr('disabled');
                        $('.sv_btn_add_btn').show();
                        $('.sv_btn_unit').show();
                        $('.sv_unit_readOnly').hide();
                    }
                    $('.pdf_link').remove();

                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        //获取下一处理人
                        $.get('/flow/trademark/queryNextHandlerList',{
                            id:id,
                            isDispatch:0,
                            roleCode:roleCode
                        },function(data){

                            $('#auditContentArea').html(template('trademarkAssignTemplate',data))
                            // 判断是否已保存过并初始化下一处理人和收集结果
                            if (!commonFunc.isEmptyObject(saveLog)) {
                                // 保存过办理信息,回显保存信息
                                saveLogId =saveLog.id
                                saveLogJson = JSON.parse(saveLog.followContent);
                                var nextHandlerId = saveLogJson.nextHandler;  // 下一处理人ID
                                var remark = saveLogJson.mark;  // 备注
                                var selector = '#trademarkAssign option[value=' + nextHandlerId + ']';
                                $(selector).attr('selected','selected');
                                $('.collectData').attr("checked","true");
                                $('.leadershipNote').val(remark);
                            }

                            // 提交表单
                            function checkData() {
                                //包装提交参数
                                var canSubmit = true;

                            }
                            // 保存和保存并提交点击事件绑定
                            $('.submitButtons .submitButton').off().on('click',function(){
                                //判断点击事件的次数
                                if(!throttle){
                                    return false
                                }
                                throttle = false
                                window.setTimeout(function () {
                                    throttle = true
                                },2000)

                                //案件ID
                                var id = $(this).attr('data-id')
                                //备注
                                var mark =$('.leadershipNote').val()
                                //下一处理人
                                var nextHandler=$('#trademarkAssign').val()
                                if(case_page.isEmpty(nextHandler)) {
                                    $('#trademarkAssign').addClass('red-border').focus().click(function(){
                                        $(this).removeClass('red-border');
                                    });
                                    layer.msg('请选择下一处理人', {icon: 5})
                                    return false;
                                }
                                if($('input[name=collectData]:checked').length == 0) {
                                    layer.msg('请确认已收集资料', {icon: 5})
                                    return false;
                                }

                                var editable = $('input[name=editable]').val();

                                //包装提交参数
                                var canSubmit = true;
                                //商标注册
                                var trademarkRegist = case_page.buildTrademarkRegist();
                                if(!case_page.isEmpty(trademarkRegist)) {
                                    var trademarkRegistListError = [];
                                    var trademarkRegistError = case_page.validateTrademarkRegist(trademarkRegist);
                                    console.log(trademarkRegistError);
                                    trademarkRegistListError.push({
                                        'index': 0,
                                        'error': trademarkRegistError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_regist_form', trademarkRegistListError);
                                    if(trademarkRegistError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkRegistError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }

                                //商标补证
                                var trademarkCertificate = case_page.buildTrademarkCertificate();
                                if(!case_page.isEmpty(trademarkCertificate)) {
                                    var trademarkCertificateListError = [];
                                    var trademarkCertificateError = case_page.validateTrademarkCertificate(trademarkCertificate);

                                    console.log(trademarkCertificateError);
                                    trademarkCertificateListError.push({
                                        'index': 0,
                                        'error': trademarkCertificateError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_certificate_form', trademarkCertificateListError);
                                    if(trademarkCertificateError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkCertificateError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }

                                //商标许可
                                var trademarkLicens = case_page.buildTrademarkLicence();
                                if(!case_page.isEmpty(trademarkLicens)) {
                                    var trademarkLicensListError = [];
                                    var trademarkLicensError = case_page.validateTrademarkLicence(trademarkLicens);
                                    console.log(trademarkLicensError);
                                    trademarkLicensListError.push({
                                        'index': 0,
                                        'error': trademarkLicensError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_licence_from', trademarkLicensListError);
                                    if(trademarkLicensError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkLicensError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }

                                //商标变更
                                var trademarkChange = case_page.buildTrademarkChange();
                                if(!case_page.isEmpty(trademarkChange)) {
                                    var trademarkChangeListError = [];
                                    var trademarkChangeError = case_page.validateTrademarkChange(trademarkChange);
                                    console.log(trademarkChangeError);
                                    trademarkChangeListError.push({
                                        'index': 0,
                                        'error': trademarkChangeError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_change_form', trademarkChangeListError);
                                    if(trademarkChangeError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkChangeError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }

                                //商标续展
                                var trademarkExtend = case_page.buildTrademarkExtend();
                                if(!case_page.isEmpty(trademarkExtend)) {
                                    var trademarkExtendListError = [];
                                    var trademarkExtendError = case_page.validateTrademarkExtend(trademarkExtend);
                                    console.log(trademarkExtendError);
                                    trademarkExtendListError.push({
                                        'index': 0,
                                        'error': trademarkExtendError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_extend_form', trademarkExtendListError);
                                    if(trademarkExtendError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkExtendError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }

                                //商标转让
                                var trademarkTransfer = case_page.buildTrademarkTransfer();
                                if(!case_page.isEmpty(trademarkTransfer)) {
                                    var trademarkTransferListError = [];
                                    var trademarkTransferError = case_page.validateTrademarkTransfer(trademarkTransfer);
                                    console.log(trademarkTransferError);
                                    trademarkTransferListError.push({
                                        'index': 0,
                                        'error': trademarkTransferError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_transfer_form', trademarkTransferListError);
                                    if(trademarkTransferError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkTransferError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }
                                var save = 0;
                                if ($(this).is('.filingSaveButton')) {
                                    // 保存
                                    save = 1;
                                } else if ($(this).is('.filingAuditButton')) {
                                    // 保存并提交
                                    save = 0;
                                }

                                NetUtis.doPostBodySimple("/flow/trademark/receiveCase", {
                                        id:id,
                                        mark:mark,
                                        activityId:activityId,
                                        pathName:pathName,
                                        nextHandler:nextHandler,
                                        editable: editable,
                                        trademarkRegist: trademarkRegist,
                                        trademarkCertificate: trademarkCertificate,
                                        trademarkLicens: trademarkLicens,
                                        trademarkChange: trademarkChange,
                                        trademarkExtend: trademarkExtend,
                                        trademarkTransfer: trademarkTransfer,
                                        save: save, // 1:保存; 0:保存并提交
                                        logId: saveLogId
                                    },function(data){
                                        if(data.code==0){
                                            $('#filingToExamineModal').modal('hide');
                                            layer.msg('提交成功', {icon: 7})
                                            //获取发起人id
                                            var val
                                            $.get('/basedata/employee/queryAllEmployee', function (data) {
                                                if($('#userId0').val()!=''){
                                                    var name=$('#userId0').val()
                                                    for(var i=0;i<data.data.length;i++){
                                                        if(data.data[i].employeeName==name){
                                                            val = data.data[i].id
                                                        }
                                                    }
                                                }else {
                                                    val = null
                                                }
                                                var timeA = timeS0()
                                                demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                            })
                                        }
                                        else if (data.code==9999)
                                        {
                                            layer.msg(data.msg,{time: 1000});
                                            wzERP.Common.TimeoutLogin();
                                            return false;
                                        }
                                        else {
                                            $('#filingToExamineModal').modal('hide');
                                            layer.msg('提交失败', {icon: 5})
                                        }
                                    },
                                    true,true)
                            })
                        })
                    })
                    // 商标查询节点
                } else if(data.data.formId=='node_trademark_query') {
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        var handlePerson = data.data.taskInfos
                        $('#auditContentArea').html(template('trademarkInquiryTemplate',data.data))
                        // 去掉退回选项
                        $('.filingAuditContent option[value=accept]').remove();
                        //根据选项动态渲染处理人
                        $("#queryResult").on('change',function(){
                            var activityId = $('#queryResult').val()
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                }
                                $('#queryPerson').html(options);
                            })
                        })

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);
                            var nextHandler = saveLogJson.nextHandler;
                            var mark = saveLogJson.mark;
                            $('.filingAuditContent textarea.mark').val(mark);
                            $('#queryResult option').each(function(){
                                if($(this).html() == saveLogJson.pathName) {
                                    $(this).attr("selected",true);
                                }
                            })
                            var activityId = $('#queryResult').val()
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            // 回显查询分析文件
                            var queryFileUrl = saveLogJson.queryFileUrl;
                            $('.filingAuditContent #queryFileUploaderLabel').html("点击重新上传").parent().prepend('<a class="ui orange button seePdf" href="' + queryFileUrl + '" style="display:inline-block" target="_blank">预览</a>');
                            $('.filingAuditContent #queryFileUploaderLabel').siblings('input[type="hidden"]').val(queryFileUrl);

                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    if(data.data[i].key == nextHandler) {
                                        options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                    } else {
                                        options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                    }
                                }
                                $('#queryPerson').html(options);
                            })
                        }

                        //资料确认提交
                        $('.submitButtons .submitButton').off().on('click',function(){
                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)

                            //案件ID
                            var id = $(this).attr('data-id')
                            //下一处理人
                            var nextHandler=$('#queryPerson').val()
                            //处理结果
                            var pathName =$('#queryResult').find("option:selected").text()
                            //处理ID
                            var activityId=$('#queryResult').val()
                            var queryFileUrl = $('input[name=queryFile]').siblings('a').attr('href');
                            if (case_page.isEmpty(nextHandler)) {
                                $('#queryPerson').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择下一处理人', {icon: 5})
                                return false;
                            }

                            if(pathName == '请选择') {
                                $('#queryResult').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择处理结果', {icon: 5})
                                return false;
                            }
                            var editable = $('input[name=editable]').val();

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }
                            var mark =  $('.filingAuditContent textarea.mark').val();

                            NetUtis.doPostBodySimple("/flow/trademark/trademarkQuery", {
                                    id:id,
                                    activityId:activityId,
                                    pathName:pathName,
                                    nextHandler:nextHandler,
                                    editable: editable,
                                    queryFileUrl: queryFileUrl,
                                    save: save,
                                    logId: saveLogId,
                                    mark: mark
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        //获取发起人id
                                        var val
                                        $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                    // 查询结果确认节点
                }else if(data.data.formId=='node_product_confirm'){
                    //激活表单编辑功能
                    if (editable == 1) {
                        $('*').removeAttr('disabled');
                        $('.sv_btn_add_btn').show();
                        $('.sv_btn_unit').show();
                        $('.sv_unit_readOnly').hide();
                    }
                    $('.pdf_link').hide().remove();

                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        var handlePerson = data.data.taskInfos
                        $('#auditContentArea').html(template('commodityConfirmationTemplate',data.data))

                        // 去掉退回选项
                        $('#confirmSubmission option').each(function(){
                            if($(this).html() == "退回") {
                                $(this).remove();
                            }
                        })

                        $("#confirmSubmission").on('change',function() {
                            var activityId = $('#confirmSubmission').val()
                            for (var i = 0; i < handlePerson.length; i++) {
                                if (handlePerson[i].activityId == activityId) {
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                if (data.code==9999)
                                {
                                    layer.msg(data.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                }
                                $('#commodityMan').html(options).show().siblings().show();
                                // 流程结束，不显示下一处理人
                                if(activityId == 'endApply') {
                                    $('#commodityMan').hide().siblings().hide();
                                }
                            })
                        })

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);
                            var nextHandler = saveLogJson.nextHandler;
                            var mark = saveLogJson.mark;
                            $('.filingAuditContent textarea.commodityDescription').val(mark);
                            $('#confirmSubmission option').each(function(){
                                if($(this).html() == saveLogJson.pathName) {
                                    $(this).attr("selected",true);
                                }
                            })
                            if($('#confirmSubmission').val() == "endApply") {
                                $('#commodityMan').hide().siblings().hide();
                            }
                            var activityId = $('#confirmSubmission').val()
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    if(data.data[i].key == nextHandler) {
                                        options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                    } else {
                                        options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                    }
                                }
                                $('#commodityMan').html(options);
                            })
                        }


                        //资料确认提交
                        $('.submitButtons .submitButton').off().on('click',function(){

                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)

                            //案件ID
                            var id = $(this).attr('data-id')
                            //备注
                            var mark =$('.commodityDescription').val()
                            //下一处理人
                            var nextHandler=$('#commodityMan').val()
                            //处理结果
                            var pathName =$('#confirmSubmission').find("option:selected").text()
                            //处理ID
                            var activityId=$('#confirmSubmission').val()

                            if (case_page.isEmpty(nextHandler) && activityId != "endApply") {
                                $('#commodityMan').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择下一处理人', {icon: 5})
                                return false;
                            }

                            if(pathName == '请选择') {
                                $('#confirmSubmission').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择处理结果', {icon: 5})
                                return false;
                            }
                            var editable = $('input[name=editable]').val();

                            //包装提交参数
                            var canSubmit = true;
                            //商标注册
                            var trademarkRegist = case_page.buildTrademarkRegist();
                            if(!case_page.isEmpty(trademarkRegist)) {
                                var trademarkRegistListError = [];
                                var trademarkRegistError = case_page.validateTrademarkRegist(trademarkRegist);
                                console.log(trademarkRegistError);
                                trademarkRegistListError.push({
                                    'index': 0,
                                    'error': trademarkRegistError,
                                });
                                canSubmit = case_page.displayFormErrors('.trademark_regist_form', trademarkRegistListError);
                                if(trademarkRegistError.currentErrorMsg != '') {
                                    layer.msg(trademarkRegistError.currentErrorMsg, {icon: 5})
                                }
                                if(!canSubmit) {
                                    return false;
                                }
                            }

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }

                            NetUtis.doPostBodySimple("/flow/trademark/productConfirm", {
                                    id:id,
                                    activityId:activityId,
                                    pathName:pathName,
                                    nextHandler:nextHandler,
                                    mark:mark,
                                    editable: editable,
                                    trademarkRegist: trademarkRegist,
                                    save: save,
                                    logId: saveLogId,
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        //获取发起人id
                                        var val
                                        $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                    // 资料处理节点
                } else if(data.data.formId=='node_info_confirm'){
                    //激活表单编辑功能
                    if (editable == 1) {
                        $('*').removeAttr('disabled');
                        $('.sv_btn_add_btn').show();
                        $('.sv_btn_unit').show();
                        $('.sv_unit_readOnly').hide();
                    }
                    $('.pdf_link').remove();
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        //获取下一节点处理信息
                        var handlePerson = data.data.taskInfos
                        //渲染处理结果
                        $('#auditContentArea').html(template('trademarkDataValidationTemplate',data.data))

                        // 去掉退回选项
                        $('.filingAuditContent option[value=goodConf]').remove();


                        //当处理结果变化时更换处理人
                        $("#dataValidation").on('change',function() {
                            //匹配处理结果和处理人节点
                            var activityId = $('#dataValidation').val()
                            for (var i = 0; i < handlePerson.length; i++) {
                                if (handlePerson[i].activityId == activityId) {
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                //渲染处理人
                                if (data.code==9999)
                                {
                                    layer.msg(data.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                }
                                $('#dataMan').html(options);
                            })
                        })

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);
                            var nextHandler = saveLogJson.nextHandler;
                            var mark = saveLogJson.mark;
                            $('.filingAuditContent textarea.confirmationNote').val(mark);
                            $('#dataValidation option').each(function(){
                                if($(this).html() == saveLogJson.pathName) {
                                    $(this).attr("selected",true);
                                }
                            })
                            var activityId = $('#dataValidation').val()
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            if(saveLogJson.isPaperReport == 1) {
                                $('input[name=isPaperReport]').attr("checked","checked");
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    if(data.data[i].key == nextHandler) {
                                        options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                    } else {
                                        options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                    }
                                }
                                $('#dataMan').html(options);
                            })
                        }

                        //资料确认提交
                        $('.submitButtons .submitButton').off().on('click',function(){
                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)

                            //案件ID
                            var id = $(this).attr('data-id')
                            //备注
                            var mark =$('.confirmationNote').val()
                            //下一处理人
                            var nextHandler=$('#dataMan').val()
                            //处理结果
                            var pathName =$('#dataValidation').find("option:selected").text()
                            var editable = $('input[name=editable]').val();

                            if(pathName == '请选择') {
                                $('#dataValidation').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择资料确认结果', {icon: 5})
                                return false;
                            }

                            if(case_page.isEmpty(nextHandler)) {
                                $('#dataMan').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择下一处理人', {icon: 5})
                                return false;
                            }

                            //处理ID
                            var activityId=$('#dataValidation').val()

                            var editable = $('input[name=editable]').val();

                            //包装提交参数
                            var canSubmit = true;
                            //商标注册
                            var trademarkRegist = case_page.buildTrademarkRegist();
                            if(!case_page.isEmpty(trademarkRegist)) {
                                var trademarkRegistListError = [];
                                var trademarkRegistError = case_page.validateTrademarkRegist(trademarkRegist);
                                console.log(trademarkRegistError);
                                trademarkRegistListError.push({
                                    'index': 0,
                                    'error': trademarkRegistError,
                                });
                                canSubmit = case_page.displayFormErrors('.trademark_regist_form', trademarkRegistListError);
                                if(trademarkRegistError.currentErrorMsg.length>0) {
                                    layer.msg(trademarkRegistError.currentErrorMsg[0], {icon: 5})
                                }
                                if(!canSubmit) {
                                    return false;
                                }
                            }

                            //商标补证
                            var trademarkCertificate = case_page.buildTrademarkCertificate();
                            if(!case_page.isEmpty(trademarkCertificate)) {
                                var trademarkCertificateListError = [];
                                var trademarkCertificateError = case_page.validateTrademarkCertificate(trademarkCertificate);

                                console.log(trademarkCertificateError);
                                trademarkCertificateListError.push({
                                    'index': 0,
                                    'error': trademarkCertificateError,
                                });
                                canSubmit = case_page.displayFormErrors('.trademark_certificate_form', trademarkCertificateListError);
                                if(trademarkCertificateError.currentErrorMsg.length>0) {
                                    layer.msg(trademarkCertificateError.currentErrorMsg[0], {icon: 5})
                                }
                                if(!canSubmit) {
                                    return false;
                                }
                            }

                            //商标许可
                            var trademarkLicens = case_page.buildTrademarkLicence();
                            if(!case_page.isEmpty(trademarkLicens)) {
                                var trademarkLicensListError = [];
                                var trademarkLicensError = case_page.validateTrademarkLicence(trademarkLicens);
                                console.log(trademarkLicensError);
                                trademarkLicensListError.push({
                                    'index': 0,
                                    'error': trademarkLicensError,
                                });
                                canSubmit = case_page.displayFormErrors('.trademark_licence_from', trademarkLicensListError);
                                if(trademarkLicensError.currentErrorMsg.length>0) {
                                    layer.msg(trademarkLicensError.currentErrorMsg[0], {icon: 5})
                                }
                                if(!canSubmit) {
                                    return false;
                                }
                            }

                            //商标变更
                            var trademarkChange = case_page.buildTrademarkChange();
                            if(!case_page.isEmpty(trademarkChange)) {
                                var trademarkChangeListError = [];
                                var trademarkChangeError = case_page.validateTrademarkChange(trademarkChange);
                                console.log(trademarkChangeError);
                                trademarkChangeListError.push({
                                    'index': 0,
                                    'error': trademarkChangeError,
                                });
                                canSubmit = case_page.displayFormErrors('.trademark_change_form', trademarkChangeListError);
                                if(trademarkChangeError.currentErrorMsg.length>0) {
                                    layer.msg(trademarkChangeError.currentErrorMsg[0], {icon: 5})
                                }
                                if(!canSubmit) {
                                    return false;
                                }
                            }

                            //商标续展
                            var trademarkExtend = case_page.buildTrademarkExtend();
                            if(!case_page.isEmpty(trademarkExtend)) {
                                var trademarkExtendListError = [];
                                var trademarkExtendError = case_page.validateTrademarkExtend(trademarkExtend);
                                console.log(trademarkExtendError);
                                trademarkExtendListError.push({
                                    'index': 0,
                                    'error': trademarkExtendError,
                                });
                                canSubmit = case_page.displayFormErrors('.trademark_extend_form', trademarkExtendListError);
                                if(trademarkExtendError.currentErrorMsg.length>0) {
                                    layer.msg(trademarkExtendError.currentErrorMsg[0], {icon: 5})
                                }
                                if(!canSubmit) {
                                    return false;
                                }
                            }

                            //商标转让
                            var trademarkTransfer = case_page.buildTrademarkTransfer();
                            if(!case_page.isEmpty(trademarkTransfer)) {
                                var trademarkTransferListError = [];
                                var trademarkTransferError = case_page.validateTrademarkTransfer(trademarkTransfer);
                                console.log(trademarkTransferError);
                                trademarkTransferListError.push({
                                    'index': 0,
                                    'error': trademarkTransferError,
                                });
                                canSubmit = case_page.displayFormErrors('.trademark_transfer_form', trademarkTransferListError);
                                if(trademarkTransferError.currentErrorMsg.length>0) {
                                    layer.msg(trademarkTransferError.currentErrorMsg[0], {icon: 5})
                                }
                                if(!canSubmit) {
                                    return false;
                                }
                            }

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }

                            var isPaperReport = 0;
                            if($('input[name=isPaperReport]').is(':checked')) {
                                isPaperReport = 1;
                            }

                            NetUtis.doPostBodySimple("/flow/trademark/infoConfirm", {
                                    id:id,
                                    mark:mark,
                                    activityId:activityId,
                                    pathName:pathName,
                                    nextHandler:nextHandler,
                                    editable: editable,
                                    trademarkRegist: trademarkRegist,
                                    trademarkCertificate: trademarkCertificate,
                                    trademarkLicens: trademarkLicens,
                                    trademarkChange: trademarkChange,
                                    trademarkExtend: trademarkExtend,
                                    trademarkTransfer: trademarkTransfer,
                                    isPaperReport: isPaperReport,
                                    save: save,
                                    logId: saveLogId,
                                },function(data){
                                    if(data.code==0){
                                        layer.msg('提交成功', {icon: 7})
                                        $('#filingToExamineModal').modal('hide');
                                        //获取发起人id
                                        var val
                                        $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                    //   通知客户盖章
                } else if(data.data.formId=='node_seal_back'){
                    //激活表单编辑功能
                    if (editable == 1) {
                        $('*').removeAttr('disabled');
                        $('.pdf_link').hide().remove();
                        $('.sv_btn_add_btn').show();
                        $('.sv_btn_unit').show();
                        $('.sv_unit_readOnly').hide();
                    }
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        //获取下一节点处理信息
                        var handlePerson = data.data.taskInfos
                        //渲染处理结果
                        $('#auditContentArea').html(template('trademarkSealTemplate',data.data))

                        // 去掉退回选项
                        $('.filingAuditContent option[value=dataConf]').remove();

                        //当处理结果变化时更换处理人
                        $("#stampAudit").on('change',function() {
                            //匹配处理结果和处理人节点
                            var activityId = $('#stampAudit').val()
                            for (var i = 0; i < handlePerson.length; i++) {
                                if (handlePerson[i].activityId == activityId) {
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                //渲染处理人
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                }
                                $('#stampHolder').html(options);
                            })
                        })

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);
                            var nextHandler = saveLogJson.nextHandler;
                            var mark = saveLogJson.mark;
                            $('.filingAuditContent textarea.sealDescription').val(mark);
                            $('#stampAudit option').each(function(){
                                if($(this).html() == saveLogJson.pathName) {
                                    $(this).attr("selected",true);
                                }
                            })
                            var activityId = $('#stampAudit').val()
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    var roleCode = handlePerson[i].groups
                                }
                            }

                            if(saveLogJson.noticed) {
                                $('input[name=noticed]').attr("checked","checked");
                            }

                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    if(data.data[i].key == nextHandler) {
                                        options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                    } else {
                                        options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                    }
                                }
                                $('#stampHolder').html(options);
                            })
                        }


                        //资料确认提交
                        $('.submitButtons .submitButton').off().on('click',function(){
                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)

                            //案件ID
                            var id = $(this).attr('data-id')
                            //备注
                            var mark =$('.sealDescription').val()
                            //下一处理人
                            var nextHandler=$('#stampHolder').val()
                            //处理结果
                            var pathName =$('#stampAudit').find("option:selected").text()

                            if (case_page.isEmpty(nextHandler)) {
                                $('#stampHolder').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择下一处理人', {icon: 5})
                                return false;
                            }

                            if(!$('.filingAuditContent input[name=noticed]').is(":checked")) {
                                layer.msg('请确认已通知客户', {icon: 5})
                                return false;
                            }

                            if(pathName == '请选择') {
                                $('#stampAudit').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择资料上传方式', {icon: 5})
                                return false;
                            }
                            var editable = $('input[name=editable]').val();

                            //处理ID
                            var activityId=$('#stampAudit').val()

                            var editable = $('input[name=editable]').val();

                            //包装提交参数
                            var canSubmit = true;
                            //商标注册
                            var trademarkRegist = case_page.buildTrademarkRegist();
                            if(!case_page.isEmpty(trademarkRegist)) {
                                var trademarkRegistListError = [];
                                var trademarkRegistError = case_page.validateTrademarkRegist(trademarkRegist);
                                console.log(trademarkRegistError);
                                trademarkRegistListError.push({
                                    'index': 0,
                                    'error': trademarkRegistError,
                                });
                                canSubmit = case_page.displayFormErrors('.trademark_regist_form', trademarkRegistListError);
                                if(trademarkRegistError.currentErrorMsg.length>0) {
                                    layer.msg(trademarkRegistError.currentErrorMsg[0], {icon: 5})
                                }
                                if(!canSubmit) {
                                    return false;
                                }
                            }

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }

                            var noticed = 0;
                            if($('input[name=noticed]').is(':checked')) {
                                noticed = 1;
                            }


                            NetUtis.doPostBodySimple("/flow/trademark/customerSealBack", {
                                    id:id,
                                    mark:mark,
                                    activityId:activityId,
                                    pathName:pathName,
                                    nextHandler:nextHandler,
                                    editable: editable,
                                    trademarkRegist: trademarkRegist,
                                    noticed: noticed,
                                    save: save,
                                    logId: saveLogId,
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        //获取发起人id
                                        var val
                                        $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                    // 提交报件节点
                } else if(data.data.formId=='node_submit_info'){
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });

                    }
                    //激活表单编辑功能
                    if (editable == 1) {
                        $('*').removeAttr('disabled');
                        $('.pdf_link').hide().remove();
                        $('.sv_btn_add_btn').show();
                        $('.sv_btn_unit').show();
                        $('.sv_unit_readOnly').hide();
                    }
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        var taskInfos = data.data.taskInfos
                        //获取下一处理人
                        $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:'tmA003'},function(data){
                            data.taskInfos=taskInfos
                            $('#auditContentArea').html(template('trademarkSubmitInformationTemplate',data))

                            // 判断是否已保存过并初始化下一处理人和收集结果
                            if (!commonFunc.isEmptyObject(saveLog)) {
                                // 保存过办理信息,回显保存信息
                                saveLogId =saveLog.id
                                saveLogJson = JSON.parse(saveLog.followContent);
                                var nextHandler = saveLogJson.nextHandler;
                                var mark = saveLogJson.mark;
                                $('.filingAuditContent textarea.submitInstructions').val(mark);
                                $('#SubmissionOfInformation option').each(function(){
                                    if($(this).val() == nextHandler) {
                                        $(this).attr("selected",true);
                                    }
                                })

                                if(saveLogJson.submitedReport) {
                                    $('input[name=submitedReport]').attr("checked","checked");
                                }

                                //获取下一处理人
                                $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                    var options = '<option value="">请选择</option>'
                                    var len = data.data.length;
                                    for(var i=0;i<len;i++){
                                        if(data.data[i].key == nextHandler) {
                                            options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                        } else {
                                            options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                        }
                                    }
                                    $('#stampHolder').html(options);
                                })
                            }

                            //资料确认提交
                            $('.submitButtons .submitButton').off().on('click',function(){
                                //判断点击事件的次数
                                if(!throttle){
                                    return false
                                }

                                throttle = false
                                window.setTimeout(function () {
                                    throttle = true
                                },2000)

                                if(!$("#dataSubmission").is(':checked')){
                                    layer.msg('请选择提交结果', {icon: 5})
                                    return false
                                }
                                //案件ID
                                var id = $(this).attr('data-id')
                                //备注
                                var mark =$('.submitInstructions').val()
                                //下一处理人
                                var nextHandler=$('#SubmissionOfInformation').val()
                                //处理结果
                                var pathName ="提交审核"

                                if (case_page.isEmpty(nextHandler)) {
                                    $('#SubmissionOfInformation').parents('.field').addClass('error').click(function(){
                                        $(this).removeClass('error');
                                    });
                                    layer.msg('请选择下一处理人', {icon: 5})
                                    return false;
                                }
                                var editable = $('input[name=editable]').val();

                                //处理ID
                                var activityId="dataCheck"

                                //包装提交参数
                                var canSubmit = true;
                                //商标注册
                                var trademarkRegist = case_page.buildTrademarkRegist();
                                if(!case_page.isEmpty(trademarkRegist)) {
                                    var trademarkRegistListError = [];
                                    var trademarkRegistError = case_page.validateTrademarkRegist(trademarkRegist);
                                    console.log(trademarkRegistError);
                                    trademarkRegistListError.push({
                                        'index': 0,
                                        'error': trademarkRegistError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_regist_form', trademarkRegistListError);
                                    if(trademarkRegistError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkRegistError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }

                                //商标补证
                                var trademarkCertificate = case_page.buildTrademarkCertificate();
                                if(!case_page.isEmpty(trademarkCertificate)) {
                                    var trademarkCertificateListError = [];
                                    var trademarkCertificateError = case_page.validateTrademarkCertificate(trademarkCertificate);

                                    console.log(trademarkCertificateError);
                                    trademarkCertificateListError.push({
                                        'index': 0,
                                        'error': trademarkCertificateError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_certificate_form', trademarkCertificateListError);
                                    if(trademarkCertificateError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkCertificateError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }

                                //商标许可
                                var trademarkLicens = case_page.buildTrademarkLicence();
                                if(!case_page.isEmpty(trademarkLicens)) {
                                    var trademarkLicensListError = [];
                                    var trademarkLicensError = case_page.validateTrademarkLicence(trademarkLicens);
                                    console.log(trademarkLicensError);
                                    trademarkLicensListError.push({
                                        'index': 0,
                                        'error': trademarkLicensError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_licence_from', trademarkLicensListError);
                                    if(trademarkLicensError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkLicensError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }

                                //商标变更
                                var trademarkChange = case_page.buildTrademarkChange();
                                if(!case_page.isEmpty(trademarkChange)) {
                                    var trademarkChangeListError = [];
                                    var trademarkChangeError = case_page.validateTrademarkChange(trademarkChange);
                                    console.log(trademarkChangeError);
                                    trademarkChangeListError.push({
                                        'index': 0,
                                        'error': trademarkChangeError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_change_form', trademarkChangeListError);
                                    if(trademarkChangeError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkChangeError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }

                                //商标续展
                                var trademarkExtend = case_page.buildTrademarkExtend();
                                if(!case_page.isEmpty(trademarkExtend)) {
                                    var trademarkExtendListError = [];
                                    var trademarkExtendError = case_page.validateTrademarkExtend(trademarkExtend);
                                    console.log(trademarkExtendError);
                                    trademarkExtendListError.push({
                                        'index': 0,
                                        'error': trademarkExtendError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_extend_form', trademarkExtendListError);
                                    if(trademarkExtendError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkExtendError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }

                                //商标转让
                                var trademarkTransfer = case_page.buildTrademarkTransfer();
                                if(!case_page.isEmpty(trademarkTransfer)) {
                                    var trademarkTransferListError = [];
                                    var trademarkTransferError = case_page.validateTrademarkTransfer(trademarkTransfer);
                                    console.log(trademarkTransferError);
                                    trademarkTransferListError.push({
                                        'index': 0,
                                        'error': trademarkTransferError,
                                    });
                                    canSubmit = case_page.displayFormErrors('.trademark_transfer_form', trademarkTransferListError);
                                    if(trademarkTransferError.currentErrorMsg.length>0) {
                                        layer.msg(trademarkTransferError.currentErrorMsg[0], {icon: 5})
                                    }
                                    if(!canSubmit) {
                                        return false;
                                    }
                                }


                                var save = 0;
                                if ($(this).is('.filingSaveButton')) {
                                    // 保存
                                    save = 1;
                                } else if ($(this).is('.filingAuditButton')) {
                                    // 保存并提交
                                    save = 0;
                                }

                                var submitedReport = 0;
                                if($('input[name=submitedReport]').is(':checked')) {
                                    submitedReport = 1;
                                }


                                NetUtis.doPostBodySimple("/flow/trademark/submitInfo", {
                                        id:id,
                                        mark:mark,
                                        activityId:activityId,
                                        pathName:pathName,
                                        nextHandler:nextHandler,
                                        editable:editable,
                                        submitedReport: submitedReport,
                                        trademarkRegist: trademarkRegist,
                                        trademarkCertificate: trademarkCertificate,
                                        trademarkLicens: trademarkLicens,
                                        trademarkChange: trademarkChange,
                                        trademarkExtend: trademarkExtend,
                                        trademarkTransfer: trademarkTransfer,
                                        save: save,
                                        logId: saveLogId,
                                    },function(data){
                                        if(data.code==0){
                                            $('#filingToExamineModal').modal('hide');
                                            layer.msg('提交成功', {icon: 7})
                                            //获取发起人id
                                            var val
                                            $.get('/basedata/employee/queryAllEmployee', function (data) {
                                                if($('#userId0').val()!=''){
                                                    var name=$('#userId0').val()
                                                    for(var i=0;i<data.data.length;i++){
                                                        if(data.data[i].employeeName==name){
                                                            val = data.data[i].id
                                                        }
                                                    }
                                                }else {
                                                    val = null
                                                }
                                                var timeA = timeS0()
                                                demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                            })
                                        }
                                        else if (data.code==9999)
                                        {
                                            layer.msg(data.msg,{time: 1000});
                                            wzERP.Common.TimeoutLogin();
                                            return false;
                                        }
                                        else {
                                            $('#filingToExamineModal').modal('hide');
                                            layer.msg('提交失败', {icon: 5})
                                        }
                                    },
                                    true,true)
                            })
                        })
                    })
                    // 提交资料审核节点
                }else if(data.data.formId=='node_submit_info_audit'){
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){

                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        //获取下一节点处理信息
                        var handlePerson = data.data.taskInfos
                        //渲染处理结果
                        $('#auditContentArea').html(template('trademarkSubmitAnAuditTemplate',data.data))
                        $('.filingAuditContent #SubmitAuditResults option').each(function(){
                            if($(this).html() == "退回") {
                                $(this).remove();
                            }
                        });
                        //当处理结果变化时更换处理人
                        $(".filingAuditContent #SubmitAuditResults").on('change',function() {
                            var roleCode;
                            //匹配处理结果和处理人节点
                            var activityId = $('#SubmitAuditResults').val()
                            for (var i = 0; i < handlePerson.length; i++) {
                                if (handlePerson[i].activityId == activityId) {
                                    roleCode = handlePerson[i].groups
                                }
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{
                                roleCode:roleCode
                            },function(data){
                                if (data.code==9999)
                                {
                                    layer.msg(data.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                                //渲染处理人
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                }
                                $('.filingAuditContent #submittingTheAuditor').html(options);
                            })
                        })

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);
                            var nextHandler = saveLogJson.nextHandler;
                            var mark = saveLogJson.mark;
                            $('.filingAuditContent textarea.submissionOfAuditInstructions').val(mark);
                            $('#SubmitAuditResults option').each(function(){
                                if($(this).html() == saveLogJson.pathName) {
                                    $(this).attr("selected",true);
                                }
                            })
                            var activityId = $('#SubmitAuditResults').val()
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    var roleCode = handlePerson[i].groups
                                }
                            }

                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    if(data.data[i].key == nextHandler) {
                                        options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                    } else {
                                        options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                    }
                                }
                                $('#submittingTheAuditor').html(options);
                            })
                        }

                        //资料确认提交
                        $('.submitButtons .submitButton').off().on('click',function(){

                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)

                            //案件ID
                            var id = $(this).attr('data-id')
                            //备注
                            var mark =$('.submissionOfAuditInstructions').val()
                            //下一处理人
                            var nextHandler=$('#submittingTheAuditor').val()
                            //处理结果
                            var pathName =$('#SubmitAuditResults').find("option:selected").text()

                            if (case_page.isEmpty(nextHandler)) {
                                $('#submittingTheAuditor').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择下一处理人', {icon: 5})
                                return false;
                            }

                            if(pathName == '请选择') {
                                $('#SubmitAuditResults').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择资料确认结果', {icon: 5})
                                return false;
                            }
                            var editable = $('input[name=editable]').val();

                            //处理ID
                            var activityId=$('#SubmitAuditResults').val()


                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }

                            NetUtis.doPostBodySimple("/flow/trademark/submitInfoAudit", {
                                    id:id,
                                    mark:mark,
                                    activityId:activityId,
                                    pathName:pathName,
                                    nextHandler:nextHandler,
                                    editable: editable,
                                    save: save,
                                    logId: saveLogId,
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        //获取发起人id
                                        var val
                                        $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })

                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                    // 寄送资料节点
                }else if(data.data.formId=='node_send_info'){
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        //获取下一节点处理信息
                        var handlePerson = data.data.taskInfos
                        //渲染处理结果
                        $('#auditContentArea').html(template('trademarkSendData',data.data))
                        //获取下一处理人

                        // 下一节点，官费付款
                        var activityId = "chiefConf"
                        var pathName = "已寄送"
                        for (var i = 0; i < handlePerson.length; i++) {
                            if (handlePerson[i].activityId == activityId) {
                                var roleCode = handlePerson[i].groups
                            }
                        }

                        $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                            if (data.code==9999)
                            {
                                layer.msg(data.msg,{time: 1000});
                                wzERP.Common.TimeoutLogin();
                                return false;
                            }
                            //渲染处理人
                            var options = '<option value="">请选择</option>'
                            var len = data.data.length;
                            for(var i=0;i<len;i++){
                                options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                            }
                            $('#submittingTheAuditor').html(options);
                        })

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);
                            var nextHandler = saveLogJson.nextHandler;
                            var mark = saveLogJson.mark;
                            $('.filingAuditContent textarea.mark').val(mark);
                            $('#expressCompany option').each(function(){
                                if($(this).html() == saveLogJson.postName) {
                                    $(this).attr("selected",true);
                                }
                            })
                            $('#expressNumber').val(saveLogJson.postCode);
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    var roleCode = handlePerson[i].groups
                                }
                            }

                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    if(data.data[i].key == nextHandler) {
                                        options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                    } else {
                                        options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                    }
                                }
                                $('#submittingTheAuditor').html(options);
                            })
                        }


                        //资料确认提交
                        $('.submitButtons .submitButton').off().on('click',function(){

                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)

                            //案件ID
                            var id = $(this).attr('data-id')
                            //备注
                            var mark =$('.mark').val()
                            //下一处理人
                            var nextHandler=$('#submittingTheAuditor').val()
                            var postCode = $('#expressNumber').val();
                            var postName = $('#expressCompany').val();

                            if (case_page.isEmpty(nextHandler)) {
                                $('#submittingTheAuditor').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择下一处理人', {icon: 5})
                                return false;
                            }

                            if(postCode == '') {
                                $('#expressNumber').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请输入快递单号', {icon: 5})
                                return false;
                            }
                            if(postName == '') {
                                $('#expressCompany').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择快递公司', {icon: 5})
                                return false;
                            }

                            var editable = $('input[name=editable]').val();

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }
                            NetUtis.doPostBodySimple("/flow/trademark/sendInfoOrCertificate", {
                                    id:id,
                                    mark:mark,
                                    activityId:activityId,
                                    nextHandler:nextHandler,
                                    editable: editable,
                                    pathName: pathName,
                                    postCode: postCode,
                                    postName: postName,
                                    save: save,
                                    logId: saveLogId,
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        //获取发起人id
                                        var val
                                        $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })

                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                    //提交报件
                }else if(data.data.formId=='node_report_submit'){
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        //获取下一节点处理信息
                        var handlePerson = data.data.taskInfos
                        //渲染处理结果
                        $('#auditContentArea').html(template('trademarkSubmitAnewspapertTemplate',data.data))
                        //当处理结果变化时更换处理人
                        $("#newspaperProcessing").on('change',function() {
                            //匹配处理结果和处理人节点
                            var activityId = $('#newspaperProcessing').val()
                            for (var i = 0; i < handlePerson.length; i++) {
                                if (handlePerson[i].activityId == activityId) {
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                if (data.code==9999)
                                {
                                    layer.msg(data.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                                //渲染处理人
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                }
                                $('#newspaperSeller').html(options);
                            })
                        })
                        //快递公司
                        $('#newspaperPaper').on('click',function(){
                            if($("#newspaperPaper").is(':checked')){
                                $('.expressMailNo').removeClass('express')
                            }else {
                                $('.expressMailNo').addClass('express')
                            }
                        })
                        //资料确认提交
                        $('.filingAuditButton').off().on('click',function(){
                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)

                            //获取快递内容
                            if($("#newspaperPaper").is(':checked')){
                                if($("#NewspaperExpressCompany").val()==''){
                                    layer.msg('请选择快递公司', {icon: 5})
                                    return false
                                }else if($("#expressMailNo").val()==''){
                                    layer.msg('请选择快递单号', {icon: 5})
                                    return false
                                }
                                var postName=$("#NewspaperExpressCompany").val()
                                var postCode=$("#expressMailNo").val()
                                var isPaperReport = 1
                            }
                            //获取快递内容
                            if(!$("#newspaperPaper").is(':checked')){
                                var isPaperReport = 0
                            }
                            //案件ID
                            var id = $(this).attr('data-id')
                            //备注
                            var mark =$('.Memo').val()
                            //下一处理人
                            var nextHandler=$('#newspaperSeller').val()
                            //处理结果
                            var pathName =$('#newspaperProcessing').find("option:selected").text()

                            if (case_page.isEmpty(nextHandler)) {
                                $('#newspaperSeller').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择下一处理人', {icon: 5})
                                return false;
                            }

                            if(pathName == '请选择') {
                                $('#newspaperProcessing').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择处理结果', {icon: 5})
                                return false;
                            }
                            var editable = $('input[name=editable]').val();

                            //处理ID
                            var activityId=$('#newspaperProcessing').val()
                            //商标申请号
                            var trademarkCode=$('#applicationNumber').val()
                            NetUtis.doPostBodySimple("/flow/trademark/submitReport", {
                                    id:id,
                                    mark:mark,
                                    activityId:activityId,
                                    pathName:pathName,
                                    nextHandler:nextHandler,
                                    postName:postName,
                                    postCode: postCode,
                                    isPaperReport:isPaperReport,
                                    trademarkCode:trademarkCode,
                                    editable: editable
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        //获取发起人id
                                        var val
                                        $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                    // 官费付款节点
                }else if(data.data.formId=='node_pay_confirm'){
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        //获取下一节点处理信息
                        var taskInfos = data.data.taskInfos
                        //获取下一处理人
                        $.get('/flow/trademark/queryNextHandlerList',{
                            id:id,
                            isDispatch:0,
                            roleCode:'tmA002'
                        },function(data){
                            data.taskInfos=taskInfos
                            $('#auditContentArea').html(template('trademarkPaymentConfirmationTemplate',data))

                            // 判断是否已保存过并初始化下一处理人和收集结果
                            if (!commonFunc.isEmptyObject(saveLog)) {
                                // 保存过办理信息,回显保存信息
                                saveLogId =saveLog.id
                                saveLogJson = JSON.parse(saveLog.followContent);
                                var nextHandler = saveLogJson.nextHandler;
                                var mark = saveLogJson.mark;
                                $('.filingAuditContent textarea.paymentMemo').val(mark);
                                if(saveLogJson.pathName == '已付') {
                                    $('input.paymentPaid').attr('checked', true);
                                }
                                $('#drawee option').each(function(){
                                    if($(this).val() == saveLogJson.nextHandler) {
                                        $(this).attr("selected",true);
                                    }
                                })

                                //获取下一处理人
                                $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:'tmA001'},function(data){
                                    var options = '<option value="">请选择</option>'
                                    var len = data.data.length;
                                    for(var i=0;i<len;i++){
                                        if(data.data[i].key == nextHandler) {
                                            options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                        } else {
                                            options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                        }
                                    }
                                    $('#submittingTheAuditor').html(options);
                                })
                            }

                            //资料确认提交
                            $('.submitButtons .submitButton').off().on('click',function(){
                                //判断点击事件的次数
                                if(!throttle){
                                    return false
                                }

                                throttle = false
                                window.setTimeout(function () {
                                    throttle = true
                                },2000)

                                if(!$(".paymentPaid").is(':checked')) {
                                    layer.msg('请选择提交结果', {icon: 5})
                                    return false
                                }
                                //案件ID
                                var id = $(this).attr('data-id')
                                //备注
                                var mark =$('.paymentMemo').val()
                                //下一处理人
                                var nextHandler=$('#drawee').val()
                                //处理结果
                                var pathName ='已付'
                                debugger
                                if (case_page.isEmpty(nextHandler) || nextHandler == '请选择') {
                                    $('#drawee').parents('.field').addClass('error').click(function(){
                                        $(this).removeClass('error');
                                    });
                                    layer.msg('请选择下一处理人', {icon: 5})
                                    return false;
                                }
                                var editable = $('input[name=editable]').val();

                                //处理ID
                                var activityId='uploadAppForm';

                                var save = 0;
                                if ($(this).is('.filingSaveButton')) {
                                    // 保存
                                    save = 1;
                                } else if ($(this).is('.filingAuditButton')) {
                                    // 保存并提交
                                    save = 0;
                                }

                                NetUtis.doPostBodySimple("/flow/trademark/infoConfirm", {
                                        id:id,
                                        mark:mark,
                                        activityId:activityId,
                                        pathName:pathName,
                                        nextHandler:nextHandler,
                                        editable: editable,
                                        isPayed:1,
                                        save: save,
                                        logId: saveLogId,
                                    },function(data){
                                        if(data.code==0){
                                            $('#filingToExamineModal').modal('hide');
                                            layer.msg('提交成功', {icon: 7})
                                            //获取发起人id
                                            var val
                                            $.get('/basedata/employee/queryAllEmployee', function (data) {
                                                if($('#userId0').val()!=''){
                                                    var name=$('#userId0').val()
                                                    for(var i=0;i<data.data.length;i++){
                                                        if(data.data[i].employeeName==name){
                                                            val = data.data[i].id
                                                        }
                                                    }
                                                }else {
                                                    val = null
                                                }
                                                var timeA = timeS0()
                                                demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                            })
                                        }
                                        else if (data.code==9999)
                                        {
                                            layer.msg(data.msg,{time: 1000});
                                            wzERP.Common.TimeoutLogin();
                                            return false;
                                        }
                                        else {
                                            $('#filingToExamineModal').modal('hide');
                                            layer.msg('提交失败', {icon: 5})
                                        }
                                    },
                                    true,true)
                            })
                        })
                    })
                    // 归档节点
                }else if(data.data.formId=='node_upload_apply'){
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').hide().remove();
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    $('#caseContent #powerAttorneyDiv label').click(function(){
                        return false;
                    })
                    $('#caseContent #trademarkUrlDiv label').click(function(){
                        return false;
                    })
                    $('#caseContent #confirmApplyDiv label').click(function(){
                        return false;
                    })
                    $('#caseContent #riskNoticeDiv label').click(function(){
                        return false;
                    })
                    $('#caseContent .sv_btn_add_btn').click(function(){
                        return false;
                    });
                    $('#caseContent .add_contact').hide();
                    $('.city-picker-dropdown').remove();
                    $('.pdf_no_link').hide().remove();
                    $('#applyUrlDiv').show();
                    $('#caseContent .add_register').hide();
                    $('#caseContent .add_contact').hide();
                    $('#caseContent .description').attr("disabled",true);
                    $('.sv_btn_add_btn').hide();
                    $('.sv_btn_unit').hide();
                    $('.sv_unit_readOnly').show();
                    $('.sv_btn_unit').off().click(function(){
                        return false;
                    }).removeClass('sv_btn_unit').css({
                        'border': '1px solid #f2711c',
                        'height': '30px',
                        'margin': '5px 5px 5px 0',
                        'padding': '0 5px',
                        'border-radius': '3px',
                        'line-height': '30px',
                    });
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        var taskInfos = data.data.taskInfos
                        //获取下一处理人
                        $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:'faA001'},function(data){
                            data.taskInfos=taskInfos
                            $('#auditContentArea').html(template('trademarkUploadBooksTemplate',data))

                            // 判断是否已保存过并初始化下一处理人和收集结果
                            if (!commonFunc.isEmptyObject(saveLog)) {
                                // 保存过办理信息,回显保存信息
                                saveLogId =saveLog.id
                                saveLogJson = JSON.parse(saveLog.followContent);
                                var nextHandler = saveLogJson.nextHandler;
                                $('input[name=pigeonholed]').attr('checked', true);
                                $('input[name=trademarkCode]').val(saveLogJson.trademarkCode);
                                // 回显申请书
                                $('.filingAuditContent #applyUploaderLabel').html("点击重新上传").siblings('input[type="hidden"]').val(saveLogJson.applyUrl);
                                $('.filingAuditContent #applyUploaderLabel').parent().prepend('<a class="ui orange button seePdf" href="' + saveLogJson.applyUrl + '" style="display:inline-block" target="_blank">预览</a>');
                                $('.filingAuditContent #applyUploaderLabel').siblings('a.pdf_no_link').attr('href', saveLogJson.applyUrl).hide();

                                //获取下一处理人
                                $.get('/flow/trademark/queryNextHandlerList',{
                                    id:id,
                                    isDispatch:0,
                                    roleCode:'faA001'
                                },function(data){
                                    var options = '<option value="">请选择</option>'
                                    var len = data.data.length;
                                    for(var i=0;i<len;i++){
                                        if(data.data[i].key == nextHandler) {
                                            options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                        } else {
                                            options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                        }
                                    }
                                    $('#uploadPeople').html(options);
                                })
                            }

                            //资料确认提交
                            $('.submitButtons .submitButton').off().on('click',function(){

                                //判断点击事件的次数
                                if(!throttle){
                                    return false
                                }

                                throttle = false
                                window.setTimeout(function () {
                                    throttle = true
                                },2000)

                                //案件ID
                                var id = $(this).attr('data-id')
                                //备注
                                var mark =$('.uploadInstructions').val()
                                //下一处理人
                                var nextHandler=$('#uploadPeople').val()
                                //处理结果
                                var pathName ='已上传'

                                if (case_page.isEmpty(nextHandler)) {
                                    $('#uploadPeople').parents('.field').addClass('error').click(function(){
                                        $(this).removeClass('error');
                                    });
                                    layer.msg('请选择下一处理人', {icon: 5})
                                    return false;
                                }
                                var editable = $('input[name=editable]').val();

                                //包装提交参数
                                var canSubmit = true;

                                var applyUrl = $('#applyUrl').val();
                                if (case_page.isEmpty(applyUrl)) {
                                    layer.msg('请上传申请书', {icon: 7})
                                    return false;
                                }
                                //处理ID
                                var activityId='acceptResult';

                                var save = 0;
                                if ($(this).is('.filingSaveButton')) {
                                    // 保存
                                    save = 1;
                                } else if ($(this).is('.filingAuditButton')) {
                                    // 保存并提交
                                    save = 0;
                                }

                                var pigeonholed = 0;
                                if ($('input[name=pigeonholed]').is(':checked')) {
                                    pigeonholed = 1;
                                }

                                if(pigeonholed == 0){
                                    layer.msg('请确认已归档', {icon: 7})
                                    return false;
                                }

                                var trademarkCode = $('input[name=trademarkCode]').val();

                                if(case_page.isEmpty(trademarkCode)) {
                                    layer.msg('请输入商标申请号', {icon: 7})
                                    return false;
                                }

                                NetUtis.doPostBodySimple("/flow/trademark/uploadApply", {
                                        id:id,
                                        activityId:activityId,
                                        pathName:pathName,
                                        nextHandler:nextHandler,
                                        mark:mark,
                                        editable: editable,
                                        applyUrl: applyUrl,
                                        pigeonholed: pigeonholed,
                                        trademarkCode: trademarkCode,
                                        trademarkRegist: {
                                        },
                                        save: save,
                                        logId: saveLogId,
                                    },function(data){
                                        if(data.code==0){
                                            $('#filingToExamineModal').modal('hide');
                                            layer.msg('提交成功', {icon: 7})
                                            //获取发起人id
                                            var val
                                            $.get('/basedata/employee/queryAllEmployee', function (data) {
                                                if($('#userId0').val()!=''){
                                                    var name=$('#userId0').val()
                                                    for(var i=0;i<data.data.length;i++){
                                                        if(data.data[i].employeeName==name){
                                                            val = data.data[i].id
                                                        }
                                                    }
                                                }else {
                                                    val = null
                                                }
                                                var timeA = timeS0()
                                                demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                            })
                                        }
                                        else if (data.code==9999)
                                        {
                                            layer.msg(data.msg,{time: 1000});
                                            wzERP.Common.TimeoutLogin();
                                            return false;
                                        }
                                        else {
                                            $('#filingToExamineModal').modal('hide');
                                            layer.msg('提交失败', {icon: 5})
                                        }
                                    },
                                    true,true)
                            })
                        })
                    })
                    // 受理通知节点
                }else if(data.data.formId=='node_notice_result'){
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #applyUrlDiv label').click(function(){return false;});
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    $('#applyUrlDiv').show();
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        //获取下一节点处理信息
                        var handlePerson = data.data.taskInfos
                        //渲染处理结果
                        $('#auditContentArea').html(template('trademarkNoticeOfActionTemplate',data.data))

                        $('.filingAuditContent option[value=uploadAppForm]').remove();

                        //当处理结果变化时更换处理人
                        $("#acceptanceResult").on('change',function() {
                            //匹配处理结果和处理人节点
                            var activityId = $('#acceptanceResult').val()
                            for (var i = 0; i < handlePerson.length; i++) {
                                if (handlePerson[i].activityId == activityId) {
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                if (data.code==9999)
                                {
                                    layer.msg(data.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                                //渲染处理人
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                }
                                $('#responsibleTaxOfficer').html(options).show().siblings().show();
                                if(activityId == 'endApply') {
                                    $('#responsibleTaxOfficer').hide().siblings().hide();
                                }
                            })
                        })

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);
                            var nextHandler = saveLogJson.nextHandler;
                            var mark = saveLogJson.mark;

                            $('.filingAuditContent textarea#acceptRemarks').val(mark);
                            $('#acceptanceResult option').each(function(){
                                if($(this).html() == saveLogJson.pathName) {
                                    $(this).attr("selected",true);
                                }
                            })

                            $('input#letterOfAcceptance').val(saveLogJson.noticeCode);

                            var activityId = $('#acceptanceResult').val()
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            // 回显寄送通知书快递公司
                            if(saveLogJson.isPosted == 1) {
                                $('input#AcceptAndSend').attr('checked', true);
                                $('.acceptanceExpress').removeClass('express')
                                $('#receivingExpressNumber').val(saveLogJson.postCode);
                                $('#acceptanceExpressCompany option').each(function(){
                                    if($(this).val() == saveLogJson.postName) {
                                        $(this).attr("selected",true);
                                    }
                                })
                            }

                            if($('#acceptanceResult').val() == "endApply") {
                                $('#responsibleTaxOfficer').hide().siblings().hide();
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    if(data.data[i].key == nextHandler) {
                                        options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                    } else {
                                        options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                    }
                                }
                                $('#responsibleTaxOfficer').html(options);
                            })

                            // 回显通知书
                            $('.filingAuditContent #noticeUploaderLabel').siblings('input[type="hidden"]').val(saveLogJson.noticeUrl);
                            $('.filingAuditContent #noticeUploaderLabel').html('<span class="ui orange button">点击重新上传</span>')
                            var noticeUrlLink = "<a href='" + saveLogJson.noticeUrl + "' target='_blank'><img src='" + saveLogJson.noticeUrl + "' style='max-width: 100px; max-height:100px;display: block;margin-bottom: 5px;' /></a>";
                            $(noticeUrlLink).insertBefore($('.filingAuditContent #noticeUploaderLabel'));

                        }



                        //快递公司
                        $('#AcceptAndSend').on('click',function(){
                            if($("#AcceptAndSend").is(':checked')){
                                $('.acceptanceExpress').removeClass('express')
                            }else {
                                $('.acceptanceExpress').addClass('express')
                            }
                        })
                        //资料确认提交
                        $('.submitButtons .submitButton').off().on('click',function(){
                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)
                            //获取快递内容
                            if($("#AcceptAndSend").is(':checked')){
                                if($("#acceptanceExpressCompany").val()==''){
                                    layer.msg('请选择快递公司', {icon: 5})
                                    return false
                                }else if($("#receivingExpressNumber").val()==''){
                                    layer.msg('请选择快递单号', {icon: 5})
                                    return false
                                }
                                var postName = $("#acceptanceExpressCompany").val()
                                var postCode = $("#receivingExpressNumber").val()
                                var isPaperReport = 1
                            }
                            //获取快递内容
                            if(!$("#AcceptAndSend").is(':checked')){
                                var isPaperReport = 0
                            }
                            //案件ID
                            var id = $(this).attr('data-id')
                            //备注
                            var mark =$('#acceptRemarks').val()
                            //下一处理人
                            var nextHandler=$('#responsibleTaxOfficer').val()
                            //处理结果
                            var pathName =$('#acceptanceResult').find("option:selected").text()
                            //处理ID
                            var activityId=$('#acceptanceResult').val()
                            //通知书编号
                            var trademarkCode=$('#letterOfAcceptance').val()
                            var editable = $('input[name=editable]').val();
                            var noticeUrl = $('input[name=noticeUrl]').val();

                            if (case_page.isEmpty(nextHandler) && activityId != "endApply") {
                                $('#responsibleTaxOfficer').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择下一处理人', {icon: 5})
                                return false;
                            }

                            if(pathName == '请选择') {
                                $('#acceptanceResult').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择处理结果', {icon: 5})
                                return false;
                            }

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }

                            NetUtis.doPostBodySimple("/flow/trademark/postNotice", {
                                    id:id,
                                    mark:mark,
                                    activityId:activityId,
                                    pathName:pathName,
                                    nextHandler:nextHandler,
                                    postName:postName,
                                    postCode:postCode,
                                    isPosted:isPaperReport,
                                    noticeCode:trademarkCode,
                                    editable: editable,
                                    noticeUrl: noticeUrl,
                                    save: save,
                                    logId: saveLogId,

                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        //获取发起人id
                                        var val
                                        $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                        //下证结果
                }else if(data.data.formId=='node_post_certificate'){
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #applyUrlDiv label').click(function(){return false;});
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    $('#applyUrlDiv').show();
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        var taskInfos = data.data.taskInfos

                        var roleCode = "faA001";

                        //获取下一处理人
                        $.get('/flow/trademark/queryNextHandlerList',{
                            roleCode:roleCode,
                        },function(data){
                            data.taskInfos=taskInfos
                            $('#auditContentArea').html(template('trademarkSendDocumentsTemplate',data))

                            var options = '<option value="">请选择</option>'
                            var len = data.data.length;
                            for(var i=0;i<len;i++){
                                options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                            }
                            $('#publicAnnouncement').html(options);

                            $("input[name=isPosted]").click(function(){
                                if($(this).val() == '0') {
                                    $("#publicAnnouncement").hide().siblings().hide();
                                } else {
                                    $("#publicAnnouncement").show().siblings().show();
                                }

                            })

                            // 判断是否已保存过并初始化下一处理人和收集结果
                            if (!commonFunc.isEmptyObject(saveLog)) {
                                // 保存过办理信息,回显保存信息
                                saveLogId =saveLog.id
                                saveLogJson = JSON.parse(saveLog.followContent);
                                var nextHandler = saveLogJson.nextHandler;
                                var mark = saveLogJson.mark;

                                $('.filingAuditContent textarea.mark').val(mark);
                                $('input#letterOfAcceptance').val(saveLogJson.noticeCode);
                                if(saveLogJson.certicateed) {
                                    $('input[name=certicateed]').attr("checked", true);
                                }
                                $('input#noticeCode').val(saveLogJson.noticeCode);
                                $('input[name=isPosted]').each(function(){
                                    if($(this).val() == saveLogJson.isPosted) {
                                        $(this).attr('checked', true)
                                    }
                                })
                                if (saveLogJson.isPosted != 1) {
                                    $("#publicAnnouncement").hide().siblings().hide();
                                }
                                $('#publicAnnouncement option').each(function(){
                                    if($(this).val() == saveLogJson.currentHandler){
                                        $(this).attr('selected', true);
                                    }
                                })

                                // 回显通知书
                                $('.filingAuditContent #noticeUploaderLabel').siblings('input[type="hidden"]').val(saveLogJson.noticeUrl);
                                $('.filingAuditContent #noticeUploaderLabel').html('<span class="ui orange button">点击重新上传</span>')
                                var noticeUrlLink = "<a href='" + saveLogJson.noticeUrl + "' target='_blank'><img src='" + saveLogJson.noticeUrl + "' style='max-width: 100px; max-height:100px;display: block;margin-bottom: 5px;' /></a>";
                                $(noticeUrlLink).insertBefore($('.filingAuditContent #noticeUploaderLabel'));
                            }

                            //资料确认提交
                            $('.submitButtons .submitButton').off().on('click',function(){
                                //判断点击事件的次数
                                if(!throttle){
                                    return false
                                }

                                throttle = false
                                window.setTimeout(function () {
                                    throttle = true
                                },2000)



                                //案件ID
                                var id = $(this).attr('data-id')
                                //备注
                                var mark =$('.mark').val()
                                //处理结果
                                var pathName ='--'
                                //处理ID
                                var activityId=$('#sendResults').val()
                                //通知书编号
                                var trademarkCode=$('#sendABook').val()

                                var certicateed = 0;
                                if($('input[name=certicateed]').is(':checked')) {
                                    certicateed = 1;
                                }
                                var noticeCode = $('input#noticeCode').val();
                                var isPosted = $("input[name=isPosted]:checked").val();
                                var nextHandler = $('#publicAnnouncement option:checked').val();

                                var editable = $('input[name=editable]').val();
                                var noticeUrl = $('input[name=noticeUrl]').val();

                                var save = 0;
                                if ($(this).is('.filingSaveButton')) {
                                    // 保存
                                    save = 1;
                                } else if ($(this).is('.filingAuditButton')) {
                                    // 保存并提交
                                    save = 0;
                                }
                                if(!$('input[name=isPosted]:checked').val()) {
                                    layer.msg('请选择是否需要寄送证件', {time: 1000});
                                    return false;
                                } else if($('input[name=isPosted]:checked').val() == '0') {
                                    activityId = 'endTask';
                                } else {
                                    activityId = 'sendCertEnd';
                                }
                                if ($('input[name=isPosted]:checked').val() != '0') {
                                    if(!nextHandler) {
                                        layer.msg('请选择下一处理人', {time: 1000});
                                        return false;
                                    }
                                }

                                if(!certicateed) {
                                    layer.msg('请确认已下证', {time: 1000});
                                    return false;
                                }
                                NetUtis.doPostBodySimple("/flow/trademark/certificateResult", {
                                        id:id,
                                        mark:mark,
                                        activityId:activityId,
                                        pathName:pathName,
                                        isPosted:isPosted,
                                        noticeCode:noticeCode,
                                        editable: editable,
                                        noticeUrl: noticeUrl,
                                        save: save,
                                        logId: saveLogId,
                                        certicateed: certicateed,
                                        nextHandler: nextHandler

                                    },function(data){
                                        if(data.code==0){
                                            $('#filingToExamineModal').modal('hide');
                                            layer.msg('提交成功', {icon: 7})
                                            //获取发起人id
                                            var val
                                            $.get('/basedata/employee/queryAllEmployee', function (data) {
                                                if($('#userId0').val()!=''){
                                                    var name=$('#userId0').val()
                                                    for(var i=0;i<data.data.length;i++){
                                                        if(data.data[i].employeeName==name){
                                                            val = data.data[i].id
                                                        }
                                                    }
                                                }else {
                                                    val = null
                                                }
                                                var timeA = timeS0()
                                                demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                            })
                                        }
                                        else if (data.code==9999)
                                        {
                                            layer.msg(data.msg,{time: 1000});
                                            wzERP.Common.TimeoutLogin();
                                            return false;
                                        }
                                        else {
                                            $('#filingToExamineModal').modal('hide');
                                            layer.msg('提交失败', {icon: 5})
                                        }
                                    },
                                    true,true)
                            })
                        })
                    })
                    // 实审通知节点
                } else  if(data.data.formId=='node_first_audit_notice'){
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #applyUrlDiv label').click(function(){return false;});
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    $('#applyUrlDiv').show();
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        var roleCode;
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        var handlePerson = data.data.taskInfos
                        $('#auditContentArea').html(template('trademarkTheTrialTemplate',data.data))

                        $('.filingAuditContent option[value=acceptResult]').remove();

                        $(".filingAuditContent #firstTrialResults").on('change',function() {
                            var activityId = $('#firstTrialResults').val()
                            for (var i = 0; i < handlePerson.length; i++) {
                                if (handlePerson[i].activityId == activityId) {
                                    roleCode = handlePerson[i].groups
                                }
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                }
                                $('#trialJudge').html(options).show().siblings().show();
                                if(activityId == 'endApply') {
                                    $('#trialJudge').hide().siblings().hide();
                                }
                            })
                        })

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            var roleCode
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);
                            var nextHandler = saveLogJson.nextHandler;
                            var mark = saveLogJson.mark;

                            $('.filingAuditContent textarea.preliminaryRemarks').val(mark);
                            $('#firstTrialResults option').each(function(){
                                if($(this).html() == saveLogJson.pathName) {
                                    $(this).attr("selected",true);
                                }
                            })

                            $('input#preliminaryExaminationBook').val(saveLogJson.noticeCode);

                            var activityId = $('.filingAuditContent #firstTrialResults').val()
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    roleCode = handlePerson[i].groups
                                }
                            }

                            if($('#firstTrialResults').val() == "endApply") {
                                $('#trialJudge').hide().siblings().hide();
                            }

                            // 回显寄送通知书快递公司
                            if(saveLogJson.isPosted == 1) {
                                $('input#trialDelivery').attr('checked', true);
                                $('.acceptanceExpress').removeClass('express')
                                $('#trialNumber').val(saveLogJson.postCode);
                                $('#trialCompany option').each(function(){
                                    if($(this).val() == saveLogJson.postName) {
                                        $(this).attr("selected",true);
                                    }
                                })
                            }

                            // 回显通知书
                            $('.filingAuditContent #noticeUploaderLabel').siblings('input[type="hidden"]').val(saveLogJson.noticeUrl);
                            $('.filingAuditContent #noticeUploaderLabel').html('<span class="ui orange button">点击重新上传</span>')
                            var noticeUrlLink = "<a href='" + saveLogJson.noticeUrl + "' target='_blank'><img src='" + saveLogJson.noticeUrl + "' style='max-width: 100px; max-height:100px;display: block;margin-bottom: 5px;' /></a>";
                            $(noticeUrlLink).insertBefore($('.filingAuditContent #noticeUploaderLabel'));

                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    if(data.data[i].key == nextHandler) {
                                        options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                    } else {
                                        options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                    }
                                }
                                $('#trialJudge').html(options);
                            })

                            // 回显通知书
                            $('.filingAuditContent #noticeUploaderLabel').siblings('input[type="hidden"]').val(saveLogJson.noticeUrl);
                            $('.filingAuditContent #noticeUploaderLabel').html('<span class="ui orange button">点击重新上传</span>')
                        }

                        //快递公司
                        $('#trialDelivery').on('click',function(){
                            if($("#trialDelivery").is(':checked')){
                                $('.trialExpress').removeClass('express')
                            }else {
                                $('.trialExpress').addClass('express')
                            }
                        })
                        //资料确认提交
                        $('.submitButtons .submitButton').off().on('click',function(){
                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)

                            //获取快递内容
                            if($("#trialDelivery").is(':checked')){
                                if($("#trialCompany").val()==''){
                                    layer.msg('请选择快递公司', {icon: 5})
                                    return false
                                }else if($("#trialNumber").val()==''){
                                    layer.msg('请选择快递单号', {icon: 5})
                                    return false
                                }
                                var postName=$("#trialCompany").val()
                                var postCode=$("#trialNumber").val()
                                var isPaperReport = 1
                            }
                            //获取快递内容
                            if(!$("#trialDelivery").is(':checked')){
                                var isPaperReport = 0
                            }
                            //案件ID
                            var id = $(this).attr('data-id')
                            //备注
                            var mark =$('.preliminaryRemarks').val()
                            //下一处理人
                            var nextHandler=$('#trialJudge').val()
                            //处理结果
                            var pathName =$('#firstTrialResults').find("option:selected").text()
                            //处理ID
                            var activityId=$('#firstTrialResults').val()
                            //通知书编号
                            var trademarkCode=$('#preliminaryExaminationBook').val()

                            if (case_page.isEmpty(nextHandler) && activityId != "endApply") {
                                $('#trialJudge').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择下一处理人', {icon: 5})
                                return false;
                            }

                            if(pathName == '请选择') {
                                $('#firstTrialResults').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择处理结果', {icon: 5})
                                return false;
                            }
                            var editable = $('input[name=editable]').val();
                            var noticeUrl = $('input[name=noticeUrl]').val();

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }

                            NetUtis.doPostBodySimple("/flow/trademark/postNotice", {
                                    id:id,
                                    mark:mark,
                                    activityId:activityId,
                                    pathName:pathName,
                                    nextHandler:nextHandler,
                                    postName:postName,
                                    postCode:postCode,
                                    isPosted:isPaperReport,
                                    noticeCode:trademarkCode,
                                    editable: editable,
                                    noticeUrl: noticeUrl,
                                    save: save,
                                    logId: saveLogId,
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        //获取发起人id
                                        var val
                                        $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                    //    公告结果
                }else if(data.data.formId=='node_notice_result2'){
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #applyUrlDiv label').click(function(){return false;});
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    $('#applyUrlDiv').show();
                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        var roleCode
                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        var handlePerson = data.data.taskInfos
                        $('#auditContentArea').html(template('trademarkNoticeTemplate',data.data))

                        $('.filingAuditContent option[value=trialResult]').remove();

                        $("#announcementResult").on('change',function() {
                            debugger
                            var activityId = $('#announcementResult').val()
                            for (var i = 0; i < handlePerson.length; i++) {
                                if (handlePerson[i].activityId == activityId) {
                                    roleCode = handlePerson[i].groups
                                }
                            }
                            if(activityId == 'endApply') {
                                $('#publicAnnouncement').hide().siblings().hide();
                            }
                            //获取下一处理人
                            if(!case_page.isEmpty(roleCode)) {
                                $.get('/flow/trademark/queryNextHandlerList',{
                                    roleCode:roleCode
                                },function(data){
                                    var options = '<option value="">请选择</option>'
                                    var len = data.data.length;
                                    for(var i=0;i<len;i++){
                                        options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                    }
                                    $('#publicAnnouncement').html(options).show().siblings().show();
                                })
                            }
                        })

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);
                            var nextHandler = saveLogJson.nextHandler;
                            var mark = saveLogJson.mark;

                            $('.filingAuditContent textarea.noticeRemarks').val(mark);
                            $('#announcementResult option').each(function(){
                                if($(this).html() == saveLogJson.pathName) {
                                    $(this).attr("selected",true);
                                }
                            })

                            $('input#noticeA').val(saveLogJson.noticeCode);

                            var activityId = $('#announcementResult').val()
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    roleCode = handlePerson[i].groups
                                }
                            }

                            if($('#announcementResult').val() == "endApply") {
                                $('#publicAnnouncement').hide().siblings().hide();
                            }

                            // 回显寄送通知书快递公司
                            if(saveLogJson.isPosted == 1) {
                                $('input#announcementExpress').attr('checked', true);
                                $('.announcementCompany').removeClass('express')
                                $('#noticeNumber').val(saveLogJson.postCode);
                                $('#announcementCompany option').each(function(){
                                    if($(this).val() == saveLogJson.postName) {
                                        $(this).attr("selected",true);
                                    }
                                })
                            }
                            // 回显通知书
                            $('.filingAuditContent #noticeUploaderLabel').siblings('input[type="hidden"]').val(saveLogJson.noticeUrl);
                            $('.filingAuditContent #noticeUploaderLabel').html('<span class="ui orange button">点击重新上传</span>')
                            var noticeUrlLink = "<a href='" + saveLogJson.noticeUrl + "' target='_blank'><img src='" + saveLogJson.noticeUrl + "' style='max-width: 100px; max-height:100px;display: block;margin-bottom: 5px;' /></a>";
                            $(noticeUrlLink).insertBefore($('.filingAuditContent #noticeUploaderLabel'));

                            if(activityId == 'endApply') {
                                $('#publicAnnouncement').hide().siblings().hide();
                            }

                            //获取下一处理人
                            if(!case_page.isEmpty(roleCode)) {
                                $.get('/flow/trademark/queryNextHandlerList',{
                                    roleCode:roleCode
                                },function(data){
                                    var options = '<option value="">请选择</option>'
                                    var len = data.data.length;
                                    for(var i=0;i<len;i++){
                                        options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                    }
                                    $('#publicAnnouncement').html(options).show().siblings().show();

                                })
                            }

                            // 回显通知书
                            $('.filingAuditContent #noticeUploaderLabel').siblings('input[type="hidden"]').val(saveLogJson.noticeUrl);
                            $('.filingAuditContent #noticeUploaderLabel').html('<span class="ui orange button">点击重新上传</span>')
                        }


                        //快递公司
                        $('#announcementExpress').on('click',function(){
                            if($("#announcementExpress").is(':checked')){
                                $('.announcementCompany').removeClass('express')
                            }else {
                                $('.announcementCompany').addClass('express')
                            }
                        })
                        //资料确认提交
                        $('.submitButtons .submitButton').off().on('click',function(){
                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)

                            //获取快递内容
                            if($("#announcementExpress").is(':checked')){
                                if($("#announcementCompany").val()==''){
                                    layer.msg('请选择快递公司', {icon: 5})
                                    return false
                                }else if($("#noticeNumber").val()==''){
                                    layer.msg('请选择快递单号', {icon: 5})
                                    return false
                                }
                                var postName=$("#announcementCompany").val()
                                var postCode=$("#noticeNumber").val()
                                var isPaperReport = 1
                            }
                            //获取快递内容
                            if(!$("#announcementExpress").is(':checked')){
                                var isPaperReport = 0
                            }
                            //案件ID
                            var id = $(this).attr('data-id')
                            //备注
                            var mark =$('.noticeRemarks').val()
                            //下一处理人
                            var nextHandler=$('#publicAnnouncement').val()
                            //处理结果
                            var pathName =$('#announcementResult').find("option:selected").text()
                            //处理ID
                            var activityId=$('#announcementResult').val()
                            //通知书编号
                            var trademarkCode=$('#noticeA').val()

                            if (case_page.isEmpty(nextHandler) && activityId != "endApply") {
                                $('#publicAnnouncement').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择下一处理人', {icon: 5})
                                return false;
                            }

                            if(pathName == '请选择') {
                                $('#announcementResult').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择处理结果', {icon: 5})
                                return false;
                            }
                            var editable = $('input[name=editable]').val();
                            var noticeUrl = $('input[name=noticeUrl]').val();

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }

                            NetUtis.doPostBodySimple("/flow/trademark/postNotice", {
                                    id:id,
                                    mark:mark,
                                    activityId:activityId,
                                    pathName:pathName,
                                    nextHandler:nextHandler,
                                    postName:postName,
                                    postCode:postCode,
                                    isPosted:isPaperReport,
                                    noticeCode:trademarkCode,
                                    editable: editable,
                                    noticeUrl:noticeUrl,
                                    save: save,
                                    logId: saveLogId,
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        $.get('/customer/queryKVList',function(data){
                                            if($('#trademarkCustomerContent').val()!=''){
                                                var val
                                                var name=$('#trademarkCustomerContent').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].value==name){
                                                        val = data.data[i].key
                                                    }
                                                }
                                            }else {
                                                var val = null
                                            }
                                            var timeA = timeS()
                                            //获取当前每页应该显示条数
                                            queryS(timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,timeA.businessId,val)
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                }else if(data.data.formId=='node_send_certificate'){
                    // 寄送证件节点
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #applyUrlDiv label').click(function(){return false;});
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    $('#applyUrlDiv').show();
                    $('#auditContentArea').html(template('trademarkSendCertificate',{}))

                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data) {
                        if (data.code == 9999) {
                            layer.msg(data.msg, {time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        var activityId = "endTask";

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);

                            $('input#trialDelivery').attr('checked', true);
                            $('#acceptanceExpressCompany option').each(function(){
                                if($(this).val() == saveLogJson.postName) {
                                    $(this).attr("selected",true);
                                }
                            })

                            $('input#trialNumber').val(saveLogJson.postCode);
                        }

                        $('.submitButtons .submitButton').off().on('click',function(){

                            var isPosted = 0;
                            if($('#trialDelivery').is(":checked")) {
                                isPosted = 1;
                            }
                            if(!isPosted) {
                                layer.msg('请确认已寄送通知书', {time: 1000})
                                return false;
                            }
                            var pathName = '已寄送';

                            var postCode = $('#trialNumber').val();
                            var postName = $('#acceptanceExpressCompany option:selected').val();
                            if (!postCode || !postName) {
                                layer.msg('请输入快递公司及快递单号', {time: 1000})
                                return false;
                            }

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }

                            NetUtis.doPostBodySimple("/flow/trademark/sendInfoOrCertificate", {
                                    id:id,
                                    activityId:activityId,
                                    postName:postName,
                                    pathName:pathName,
                                    postCode:postCode,
                                    isPosted:isPosted,
                                    editable: editable,
                                    save: save,
                                    logId: saveLogId,
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        //获取发起人id
                                        var val
                                        $.get('/basedata/employee/queryAllEmployee', function (data) {
                                            if($('#userId0').val()!=''){
                                                var name=$('#userId0').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].employeeName==name){
                                                        val = data.data[i].id
                                                    }
                                                }
                                            }else {
                                                val = null
                                            }
                                            var timeA = timeS0()
                                            demo(0,timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,val,timeA.statusCode);
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)


                        });
                    });
                }else if(data.data.formId=='node_send_certificate'){
                    // 寄送证件节点
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #applyUrlDiv label').click(function(){return false;});
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }
                    $('#applyUrlDiv').show();
                    $('#auditContentArea').html(template('trademarkSendCertificate',{}))

                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data) {
                        if (data.code == 9999) {
                            layer.msg(data.msg, {time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }
                        var activityId = "endTask";

                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);

                            $('input#trialDelivery').attr('checked', true);
                            $('#acceptanceExpressCompany option').each(function(){
                                if($(this).val() == saveLogJson.postName) {
                                    $(this).attr("selected",true);
                                }
                            })

                            $('input#trialNumber').val(saveLogJson.postCode);
                        }

                        $('.submitButtons .submitButton').off().on('click',function(){

                            var isPosted = 0;
                            if($('#trialDelivery').is(":checked")) {
                                isPosted = 1;
                            }
                            if(!isPosted) {
                                layer.msg('请确认已寄送通知书', {time: 1000})
                                return false;
                            }
                            var pathName = '已寄送';

                            var postCode = $('#trialNumber').val();
                            var postName = $('#acceptanceExpressCompany option:selected').val();
                            if (!postCode || !postName) {
                                layer.msg('请输入快递公司及快递单号', {time: 1000})
                                return false;
                            }

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }

                            NetUtis.doPostBodySimple("/flow/trademark/sendInfoOrCertificate", {
                                    id:id,
                                    activityId:activityId,
                                    postName:postName,
                                    pathName:pathName,
                                    postCode:postCode,
                                    isPosted:isPosted,
                                    editable: editable,
                                    save: save,
                                    logId: saveLogId,
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        $.get('/customer/queryKVList',function(data){
                                            if($('#trademarkCustomerContent').val()!=''){
                                                var val
                                                var name=$('#trademarkCustomerContent').val()

                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].value==name){
                                                        val = data.data[i].key
                                                    }
                                                }
                                            }else {
                                                var val = null
                                            }
                                            var timeA = timeS()
                                            var caseStatus = $("#trademarkCaseStatus").val()
                                            var isPaper = $("#trademarkIsPaper").val()
                                            //获取当前每页应该显示条数
                                            queryS(timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,timeA.businessId,val,caseStatus,isPaper)
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)


                        });
                    });
                }else  if(data.data.formId=='node_info_audit'){
                    //  资料审核节点
                    if(editable == 0) {
                        //关闭点击事件
                        $('#caseContent input').attr('disabled', 'disabled');
                        $('.city-picker-dropdown').remove();
                        $('#caseContent .add_register').hide();
                        $('#caseContent .add_contact').hide();
                        $('.pdf_no_link').remove();
                        $('#caseContent #applyUrlDiv label').click(function(){return false;});
                        $('#caseContent #powerAttorneyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #trademarkUrlDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #confirmApplyDiv label').click(function(){
                            return false;
                        })
                        $('#caseContent #riskNoticeDiv label').click(function(){
                            return false;
                        })

                        $('#caseContent .sv_btn_add_btn').click(function(){
                            return false;
                        });
                        $('#caseContent .description').attr("disabled",true);
                        $('.sv_btn_add_btn').hide();
                        $('.sv_btn_unit').hide();
                        $('.sv_unit_readOnly').show();
                        $('.sv_btn_unit').off().click(function(){
                            return false;
                        }).removeClass('sv_btn_unit').css({
                            'border': '1px solid #f2711c',
                            'height': '30px',
                            'margin': '5px 5px 5px 0',
                            'padding': '0 5px',
                            'border-radius': '3px',
                            'line-height': '30px',
                        });
                    }

                    //获取下一节点
                    $.get('/flow/trademark/nextNodeInfo',{id:id},function(data){
                        var roleCode

                        if (data.code==9999)
                        {
                            layer.msg(data.msg,{time: 1000});
                            wzERP.Common.TimeoutLogin();
                            return false;
                        }




                        //获取下一节点处理信息
                        var handlePerson = data.data.taskInfos
                        //渲染处理结果
                        $('#auditContentArea').html(template('trademarkDataAuditTemplate',data.data))


                        // 判断是否已保存过并初始化下一处理人和收集结果
                        if (!commonFunc.isEmptyObject(saveLog)) {
                            debugger
                            // 保存过办理信息,回显保存信息
                            saveLogId =saveLog.id
                            saveLogJson = JSON.parse(saveLog.followContent);

                            $('#dataResult option').each(function(){
                                if($(this).val() == saveLogJson.activityId) {
                                    $(this).attr("selected",true);
                                }
                            })

                            var activityId = $('#dataResult').val()
                            for(var i = 0;i<handlePerson.length;i++){
                                if(handlePerson[i].activityId==activityId){
                                    roleCode = handlePerson[i].groups
                                }
                            }

                            //获取下一处理人
                            if(!case_page.isEmpty(roleCode)) {
                                $.get('/flow/trademark/queryNextHandlerList',{
                                    roleCode:roleCode
                                },function(data){
                                    var options = '<option value="">请选择</option>'
                                    var len = data.data.length;
                                    var saveLogJson = JSON.parse(saveLog.followContent);
                                    for(var i=0;i<len;i++){
                                        if(data.data[i].key == saveLogJson.nextHandler) {
                                            options += '<option value="' + data.data[i].key + '" selected>' + data.data[i].value + '</option>';
                                        } else {
                                            options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                        }
                                    }
                                    $('#auditor').html(options);
                                })
                            }
                            $('.auditInstructions').val(saveLogJson.mark);
                        }


                        //当处理结果变化时更换处理人
                        $("#dataResult").on('change',function() {
                            //匹配处理结果和处理人节点
                            var activityId = $('#dataResult').val()
                            for (var i = 0; i < handlePerson.length; i++) {
                                if (handlePerson[i].activityId == activityId) {
                                    var roleCode = handlePerson[i].groups
                                }
                            }
                            //获取下一处理人
                            $.get('/flow/trademark/queryNextHandlerList',{id:id,isDispatch:0,roleCode:roleCode},function(data){
                                if (data.code==9999)
                                {
                                    layer.msg(data.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                                //渲染处理人
                                var options = '<option value="">请选择</option>'
                                var len = data.data.length;
                                for(var i=0;i<len;i++){
                                    options += '<option value="' + data.data[i].key + '">' + data.data[i].value + '</option>';
                                }
                                $('#auditor').html(options);


                            })
                        })
                        //资料确认提交
                        $('.submitButtons .submitButton').off().on('click',function(){
                            //判断点击事件的次数
                            if(!throttle){
                                return false
                            }

                            throttle = false
                            window.setTimeout(function () {
                                throttle = true
                            },2000)

                            //案件ID
                            var id = $(this).attr('data-id')
                            //备注
                            var mark =$('.auditInstructions').val()
                            //下一处理人
                            var nextHandler=$('#auditor').val()
                            //处理结果
                            var pathName =$('#dataResult').find("option:selected").text()

                            if(pathName == '请选择') {
                                $('#dataResult').parents('.field').addClass('error').click(function(){
                                    $(this).removeClass('error');
                                });
                                layer.msg('请选择资料确认结果', {icon: 5})
                                return false;
                            }
                            var editable = $('input[name=editable]').val();
                            //处理ID
                            var activityId=$('#dataResult').val()

                            var save = 0;
                            if ($(this).is('.filingSaveButton')) {
                                // 保存
                                save = 1;
                            } else if ($(this).is('.filingAuditButton')) {
                                // 保存并提交
                                save = 0;
                            }

                            NetUtis.doPostBodySimple("/flow/trademark/infoAudit", {
                                    id:id,
                                    mark:mark,
                                    activityId:activityId,
                                    pathName:pathName,
                                    nextHandler:nextHandler,
                                    editable: editable,
                                    save: save,
                                    logId: saveLogId,
                                },function(data){
                                    if(data.code==0){
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交成功', {icon: 7})
                                        $.get('/customer/queryKVList',function(data){
                                            if($('#trademarkCustomerContent').val()!=''){
                                                var val
                                                var name=$('#trademarkCustomerContent').val()
                                                for(var i=0;i<data.data.length;i++){
                                                    if(data.data[i].value==name){
                                                        val = data.data[i].key
                                                    }
                                                }
                                            }else {
                                                var val = null
                                            }
                                            var timeA = timeS()
                                            //获取当前每页应该显示条数
                                            queryS(timeA.page,timeA.num,timeA.searchKey,timeA.startDate,timeA.endDate,timeA.businessId,val)
                                        })
                                    }
                                    else if (data.code==9999)
                                    {
                                        layer.msg(data.msg,{time: 1000});
                                        wzERP.Common.TimeoutLogin();
                                        return false;
                                    }
                                    else {
                                        $('#filingToExamineModal').modal('hide');
                                        layer.msg('提交失败', {icon: 5})
                                    }
                                },
                                true,true)
                        })
                    })
                }
            })
        })
    }
})
var case_page;
case_page = {

    //请求接口地址
    urlLink: {
        getCaseDetail: '/trademark/case/queryDetail',
        brand_sv_classify: '/filing/manage/queryServiceTypeList', //商标大类列表
        brand_svLv3_classify: '/filing/manage/searchThreeLevel',//商标三级大类列表
    },

    //初始化页面
    init: function () {
        var self = this;
        self.brand_lv3_obj = {};//服务选择时候 记忆所选 商标lv3项
        self.cd_od_dt = {};//订单详情信息
        self.may_case_sku_lt = [],//可立案的sku 列表
            self.may_build_case_sku_lt = {},
            self.submit_data = {}; //立案提交数据
        self.brand_lv3_obj = {};//服务选择时候 记忆所选 商标lv3项
        self.cases_detail = {}; //案件编辑时立案详情
        self._bdlv3 = {}; //商标三级检索 临时保存
        self._customerDate = {};//订单客户信息
        self.isfirstbuild = true; //建立表单判断
        self.labelSort = 5000;
        self.labelSort_w = 1;
    },
    //上传图片
    uploadFile: function (body_ele, ele_trigger, ele_form) {
        /*Arg Guide
         @ trigger_id 触发按钮id(label)
         @ form_id 表单提交的id
         */
        $(body_ele).on('click', ele_trigger, function () {
            var $self = $(this);
            var input_name = $(this).attr('for');
            var $input_file = $('#' + input_name); //获取上传文件的input
            var maxSize = 2 * 1024 * 1024;//最大容量
            $input_file.off('change').change(function () {
                var $iVal = $input_file.val();
                if ($iVal) {
                    if (!($iVal.endsWith('jpg') || $iVal.endsWith('jpeg'))) {
                        layer.msg('请上传JPG图片格式', {icon: 5})
                    } else {
                        if ($input_file[0].files[0].size > maxSize) {
                            layer.msg('上传图片不能超过2M', {icon: 5});
                            return false;
                        }
                        $(ele_form).ajaxSubmit({
                            type: 'POST',
                            success: function (result) {
                                if (result.code == 0) {
                                    var filePath = result.data.filePath;
                                    var fileName = result.data.fileName;
                                    var img = document.createElement('img');
                                    img.src = filePath;
                                    img.name = fileName;
                                    $self.siblings('input[type="hidden"]').val(filePath);
                                    $self.html("").append($(img));
                                    $self.parent().addClass('hover-show');
                                    if($self.siblings("a").length > 0) {
                                        $self.siblings('a').attr('href', filePath);
                                    } else {
                                        $("<a>").attr({
                                            "href": filePath,
                                            "target": "_blank",
                                            "class": "img_link"
                                        }).html("点击查看大图").insertAfter($self);
                                    }
                                    $self.parent().find('.zoom-label').off('click').click(function () {
                                        file.openBigPic('#bigPicShowLayer', filePath);
                                    });
                                    $input_file.val('');
                                }
                                else if (result.code==9999)
                                {
                                    layer.msg(result.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                            }
                        });
                    }
                }
            })
        })
    },
    //上传申请书
    uploadApplyFile: function (body_ele, ele_trigger, ele_form) {
        /*Arg Guide
         @ trigger_id 触发按钮id(label)
         @ form_id 表单提交的id
         */
        $(body_ele).on('click', ele_trigger, function () {
            var $self = $(this);
            var input_name = $(this).attr('for');
            var $input_file = $('#' + input_name); //获取上传文件的input
            var maxSize = 2 * 1024 * 1024;//最大容量
            $input_file.off('change').change(function () {
                var $iVal = $input_file.val();
                if ($iVal) {
                    if (!($iVal.endsWith('jpg') || $iVal.endsWith('jpeg'))) {
                        layer.msg('请上传JPG图片格式', {icon: 5})
                    } else {
                        if ($input_file[0].files[0].size > maxSize) {
                            layer.msg('上传图片不能超过2M', {icon: 5});
                            return false;
                        }
                        $(ele_form).ajaxSubmit({
                            type: 'POST',
                            success: function (result) {
                                if (result.code == 0) {
                                    var filePath = result.data.filePath;
                                    var fileName = result.data.fileName;
                                    var img = document.createElement('img');
                                    img.src = filePath;
                                    img.name = fileName;
                                    $self.siblings('input[type="hidden"]').val(filePath);
                                    $self.html("").append($(img));
                                    $self.parent().addClass('hover-show');
                                    if($self.siblings("a").length > 0) {
                                        $self.siblings('a').attr('href', filePath);
                                    } else {
                                        $("<a>").attr({
                                            "href": filePath,
                                            "target": "_blank",
                                            "class": "img_link"
                                        }).html("点击查看大图").insertAfter($self);
                                    }
                                    $self.parent().find('.zoom-label').off('click').click(function () {
                                        file.openBigPic('#bigPicShowLayer', filePath);
                                    });
                                    $input_file.val('');
                                }
                                else if (result.code==9999)
                                {
                                    layer.msg(result.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                            }
                        });
                    }
                }
            })
        })
    },
    //上传申请确认书
    uploadConfirmApply: function (body_ele, ele_trigger, ele_form) {
        /*Arg Guide
         @ trigger_id 触发按钮id(label)
         @ form_id 表单提交的id
         */
        $(body_ele).on('click', ele_trigger, function () {
            var $self = $(this);
            var input_name = $(this).attr('for');
            var $input_file = $('#' + input_name); //获取上传文件的input
            var maxSize = 2 * 1024 * 1024;//最大容量
            $input_file.off('change').change(function () {
                var $iVal = $input_file.val();
                if ($iVal) {
                    if (!($iVal.endsWith('jpg') || $iVal.endsWith('jpeg'))) {
                        layer.msg('请上传JPG图片格式', {icon: 5})
                    } else {
                        if ($input_file[0].files[0].size > maxSize) {
                            layer.msg('上传图片不能超过2M', {icon: 5});
                            return false;
                        }
                        $(ele_form).ajaxSubmit({
                            type: 'POST',
                            success: function (result) {
                                if (result.code == 0) {
                                    var filePath = result.data.filePath;
                                    var fileName = result.data.fileName;
                                    var img = document.createElement('img');
                                    img.src = filePath;
                                    img.name = fileName;
                                    $self.siblings('input[type="hidden"]').val(filePath);
                                    $self.html("").append($(img));
                                    $self.parent().addClass('hover-show');
                                    if($self.siblings("a").length > 0) {
                                        $self.siblings('a').attr('href', filePath);
                                    } else {
                                        $("<a>").attr({
                                            "href": filePath,
                                            "target": "_blank",
                                            "class": "img_link"
                                        }).html("点击查看大图").insertAfter($self);
                                    }
                                    $self.parent().find('.zoom-label').off('click').click(function () {
                                        file.openBigPic('#bigPicShowLayer', filePath);
                                    });
                                    $input_file.val('');
                                }
                                else if (result.code==9999)
                                {
                                    layer.msg(result.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                            }
                        });
                    }
                }
            })
        })
    },
    //上传风险告知
    uploadRiskNotice: function (body_ele, ele_trigger, ele_form) {
        /*Arg Guide
         @ trigger_id 触发按钮id(label)
         @ form_id 表单提交的id
         */
        $(body_ele).on('click', ele_trigger, function () {
            var $self = $(this);
            var input_name = $(this).attr('for');
            var $input_file = $('#' + input_name); //获取上传文件的input
            var maxSize = 2 * 1024 * 1024;//最大容量
            $input_file.off('change').change(function () {
                var $iVal = $input_file.val();
                if ($iVal) {
                    if (!($iVal.endsWith('jpg') || $iVal.endsWith('jpeg'))) {
                        layer.msg('请上传JPG图片格式', {icon: 5})
                    } else {
                        if ($input_file[0].files[0].size > maxSize) {
                            layer.msg('上传图片不能超过2M', {icon: 5});
                            return false;
                        }
                        $(ele_form).ajaxSubmit({
                            type: 'POST',
                            success: function (result) {
                                if (result.code == 0) {
                                    var filePath = result.data.filePath;
                                    var fileName = result.data.fileName;
                                    var img = document.createElement('img');
                                    img.src = filePath;
                                    img.name = fileName;
                                    $self.siblings('input[type="hidden"]').val(filePath);
                                    $self.html("").append($(img));
                                    $self.parent().addClass('hover-show');
                                    if($self.siblings("a").length > 0) {
                                        $self.siblings('a').attr('href', filePath);
                                    } else {
                                        $("<a>").attr({
                                            "href": filePath,
                                            "target": "_blank",
                                            "class": "img_link"
                                        }).html("点击查看大图").insertAfter($self);
                                    }
                                    $self.parent().find('.zoom-label').off('click').click(function () {
                                        file.openBigPic('#bigPicShowLayer', filePath);
                                    });
                                    $input_file.val('');
                                }
                                else if (result.code==9999)
                                {
                                    layer.msg(result.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                            }
                        });
                    }
                }
            })
        })
    },
    //上传通知书
    uploadNoticeFile: function (body_ele, ele_trigger, ele_form) {
        /*Arg Guide
         @ trigger_id 触发按钮id(label)
         @ form_id 表单提交的id
         */
        $(body_ele).on('click', ele_trigger, function () {
            var $self = $(this);
            var input_name = $(this).attr('for');
            var $input_file = $('#' + input_name); //获取上传文件的input
            var maxSize = 2 * 1024 * 1024;//最大容量
            $input_file.off('change').change(function () {
                var $iVal = $input_file.val();
                if ($iVal) {
                    if (!($iVal.endsWith('jpg') || $iVal.endsWith('jpeg'))) {
                        layer.msg('请上传JPG图片格式', {icon: 5})
                    } else {
                        if ($input_file[0].files[0].size > maxSize) {
                            layer.msg('上传图片不能超过2M', {icon: 5});
                            return false;
                        }
                        $(ele_form).ajaxSubmit({
                            type: 'POST',
                            success: function (result) {
                                if (result.code == 0) {
                                    var filePath = result.data.filePath;
                                    var fileName = result.data.fileName;
                                    var img = document.createElement('img');
                                    img.src = filePath;
                                    img.name = fileName;
                                    $(img).css({
                                        "max-width": "100px",
                                        "max-height": "100px"
                                    })
                                    var imgLink = document.createElement('a');
                                    $(imgLink).attr({
                                        'target': "_blank",
                                        'href': filePath
                                    })
                                    imgLink.append(img);
                                    $self.siblings('input[type="hidden"]').val(filePath);
                                    $self.parent().find('img').hide();//隐藏上传提示图片
                                    $self.parent().prepend($(imgLink));//显示返回的图片
                                    $self.css({
                                        "display": "block",
                                        "margin-top": "5px"
                                    }).html('<span class="ui orange button">点击重新上传</span>');
                                    $self.parent().addClass('hover-show');
                                    $self.parent().find('.zoom-label').off('click').click(function () {
                                        file.openBigPic('#bigPicShowLayer', filePath);
                                    });
                                    $input_file.val('');
                                }
                                else if (result.code==9999)
                                {
                                    layer.msg(result.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                            }
                        });
                    }
                }
            })
        })
    },
    //上传营业执照
    uploadBusinessLicence: function (body_ele, ele_trigger, ele_form) {
        /*Arg Guide
         @ trigger_id 触发按钮id(label)
         @ form_id 表单提交的id
         */
        $(body_ele).on('click', ele_trigger, function () {
            var $self = $(this);
            var input_name = $(this).attr('for');
            var $input_file = $('#' + input_name); //获取上传文件的input
            var maxSize = 2 * 1024 * 1024;//最大容量
            $input_file.off('change').change(function () {
                var $iVal = $input_file.val();
                if ($iVal) {
                    if (!$iVal.endsWith('pdf')) {
                        layer.msg('请上传pdf格式', {icon: 5})
                    } else {
                        if ($input_file[0].files[0].size > maxSize) {
                            layer.msg('上传pdf不能超过2M', {icon: 5});
                            return false;
                        }
                        $(ele_form).ajaxSubmit({
                            type: 'POST',
                            success: function (result) {
                                if (result.code == 0) {
                                    var filePath = result.data.filePath;
                                    var fileName = result.data.fileName;
                                    $self.text('重新上传');
                                    $self.siblings('a').remove('.seePdf')
                                    $self.parent().prepend('<a class="ui orange button seePdf" href="' + filePath + '" style="display:inline-block" target="_blank">预览</a>');
                                    $self.siblings('input[type="hidden"]').val(filePath);
                                    $self.siblings('a.pdf_no_link').attr('href', filePath).hide();
                                    $input_file.val('');
                                    layer.msg('上传成功!', {icon: 7});
                                }
                                else if (result.code==9999)
                                {
                                    layer.msg(result.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                            }
                        });
                    }
                }
            })
        })
    },
    //上传商标注册证
    uploadTrademarkUrl: function (body_ele, ele_trigger, ele_form) {
        /*Arg Guide
         @ trigger_id 触发按钮id(label)
         @ form_id 表单提交的id
         */
        $(body_ele).on('click', ele_trigger, function () {
            var $self = $(this);
            var input_name = $(this).attr('for');
            var $input_file = $('#' + input_name); //获取上传文件的input
            var maxSize = 2 * 1024 * 1024;//最大容量
            $input_file.off('change').change(function () {
                var $iVal = $input_file.val();
                if ($iVal) {
                    if (!$iVal.endsWith('pdf')) {
                        layer.msg('请上传pdf格式', {icon: 5})
                    } else {
                        if ($input_file[0].files[0].size > maxSize) {
                            layer.msg('上传pdf不能超过2M', {icon: 5});
                            return false;
                        }
                        $(ele_form).ajaxSubmit({
                            type: 'POST',
                            success: function (result) {
                                if (result.code == 0) {
                                    var filePath = result.data.filePath;
                                    var fileName = result.data.fileName;
                                    $self.text('重新上传');
                                    $self.siblings('a').remove('.seePdf')
                                    $self.parent().prepend('<a class="ui orange button seePdf" href="' + filePath + '" style="display:inline-block" target="_blank">预览</a>');
                                    $self.siblings('input[type="hidden"]').val(filePath);
                                    $self.siblings('a.pdf_no_link').attr('href', filePath).hide();
                                    $input_file.val('');
                                    layer.msg('上传成功!', {icon: 7});
                                }
                                else if (result.code==9999)
                                {
                                    layer.msg(result.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                            }
                        });
                    }
                }
            })
        })
    },
    //上传pdf
    uploadFilePdf: function (body_ele, ele_trigger, ele_form) {
        /*Arg Guide
         @ trigger_id 触发按钮id(label)
         @ form_id 表单提交的id
         */
        $(body_ele).on('click', ele_trigger, function () {
            var $self = $(this);
            var input_name = $(this).attr('for');
            var $input_file = $('#' + input_name); //获取上传文件的input
            var maxSize = 2 * 1024 * 1024;//最大容量
            $input_file.off('change').change(function () {
                var $iVal = $input_file.val();
                if ($iVal) {
                    if (!$iVal.endsWith('pdf')) {
                        layer.msg('请上传pdf格式', {icon: 5})
                    } else {
                        if ($input_file[0].files[0].size > maxSize) {
                            layer.msg('上传pdf不能超过2M', {icon: 5});
                            return false;
                        }
                        $(ele_form).ajaxSubmit({
                            type: 'POST',
                            success: function (result) {
                                if (result.code == 0) {
                                    var filePath = result.data.filePath;
                                    var fileName = result.data.fileName;
                                    $self.text('重新上传');
                                    $self.siblings('a').remove('.seePdf')
                                    $self.parent().prepend('<a class="ui orange button seePdf" href="' + filePath + '" style="display:inline-block" target="_blank">预览</a>');
                                    $self.siblings('input[type="hidden"]').val(filePath);
                                    $self.siblings('a.pdf_no_link').attr('href', filePath).hide();
                                    $input_file.val('');
                                    layer.msg('上传成功!', {icon: 7});
                                }
                                else if (result.code==9999)
                                {
                                    layer.msg(result.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                            }
                        });
                    }
                }
            })
        })
    },
    //上传DOC
    uploadFileDoc: function (body_ele, ele_trigger, ele_form) {
        /*Arg Guide
         @ trigger_id 触发按钮id(label)
         @ form_id 表单提交的id
         */
        $(body_ele).on('click', ele_trigger, function () {
            var $self = $(this);
            var input_name = $(this).attr('for');
            var $input_file = $('#' + input_name); //获取上传文件的input
            var maxSize = 10 * 1024 * 1024;//最大容量
            $input_file.off('change').change(function () {
                var $iVal = $input_file.val();
                if ($iVal) {
                    if (!$iVal.endsWith('doc') && !$iVal.endsWith('docx')) {
                        layer.msg('请上传Word格式', {icon: 5})
                    } else {
                        if ($input_file[0].files[0].size > maxSize) {
                            layer.msg('上传word不能超过10M', {icon: 5});
                            return false;
                        }
                        $(ele_form).ajaxSubmit({
                            type: 'POST',
                            success: function (result) {
                                if (result.code == 0) {
                                    var filePath = result.data.filePath;
                                    var fileName = result.data.fileName;
                                    $self.text('重新上传文件');
                                    $self.siblings('a').remove('.seePdf')
                                    $self.parent().prepend('<span style="cursor:pointer;" onclick="removeUploaded()">X</span>');
                                    $self.parent().prepend('<a class="ui orange button seePdf" href="' + filePath + '" style="display:inline-block" target="_blank">预览</a>');
                                    $self.siblings('input[type="hidden"]').val(filePath);
                                    $input_file.val('');
                                    layer.msg('上传成功!', {icon: 7});
                                }
                                else if (result.code==9999)
                                {
                                    layer.msg(result.msg,{time: 1000});
                                    wzERP.Common.TimeoutLogin();
                                    return false;
                                }
                            }
                        });
                    }
                }
            })
        })
    },
    validate: function (_selector) {
        $(_selector).form({
            on: 'blur',
            // inline: true,
            transition: 'fade',
            fields: {
                //公司名称
                companyName: {
                    identifier: 'companyName',
                    rules: [{
                        type: 'empty',
                        prompt: '请输入名称'
                    },
                        {
                            type: 'regExp[/^.{0,50}$/]',
                            prompt: '限制50字'
                        }]
                },
                //联系电话
                contactNumber: {
                    identifier: 'contactNumber',
                    rules: [{
                        type: 'empty',
                        prompt: '请输入联系电话'
                    },
                        {
                            type: 'regExp[/^[0-9-]{0,20}$/]',
                            prompt: '只能输入数字及-，字数限制20字'
                        }]
                },
                //手机号码
                phoneNumber: {
                    identifier: 'phoneNumber',
                    rules: [{
                        type: 'empty',
                        prompt: '请输入联系电话'
                    },
                        {
                            type: 'regExp[/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/]',
                            prompt: '请输入正确的手机号码'
                        }]
                },

                //邮箱
                email: {
                    identifier: 'email',
                    optional: true,
                    rules: [{
                        type: 'regExp[/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/]',
                        prompt: '请输入正确的格式'
                    },
                        {
                            type: 'regExp[/^.{0,30}$/]',
                            prompt: '字数限制30字'
                        }]
                },
            }
        });
    },

    // component---------
    // 商标服务一级大类查询
    brand_check_func: function(searchKey,level,_this){
        var self = this;
        var _url = self.urlLink.brand_sv_classify;
        var _param = {
            searchKey: searchKey,
            level: level,
        };
        var succ = function(res){
            if(res.code == 0){
                // console.log(res);
                if(res.data.length==0){
                    layer.msg('无匹配结果！请重新输入检索内容',{time: 1000});
                }
                var data = res.data,_html='';
                $.each(data,function(index,value){
                    _html += '<div data-id="'+ value.bigtypeid +'" class="classify_cont_unit">'+ value.bigtypename +'</div>';
                });
                _this.parent().find('.classify_cont_grp').html(_html).removeClass('zy_hide').children('.classify_cont_unit').on('click',function(){
                    var _el = _this.parents('.brand_type_lev1_div');
                    _el.find('.classify_store').val($(this).data('id'));
                    _el.find('.classify_ip').val($(this).text());
                    $(this).parent().addClass('zy_hide');
                });
            }
            else if (res.code==9999)
            {
                layer.msg(res.msg,{time: 1000});
                wzERP.Common.TimeoutLogin();
            }
            else{
                layer.msg(res.msg,{time: 1000});
            }
        }
        commonFunc.ajax_get(_url,_param,succ,{contentType: 'application/x-www-form-urlencoded'});
    },
    //商标服务三级查询dlg，左侧数据渲染
    brandlv3_rmenu_render: function (data){
        console.log(data)
        var self = this;
        var _tpl = '<h5 style="font-size: 24px;">{{data[0].bigtypename}}</h5>'+
            '{{each data v i}}'+
            '<div class="sv_lv3_unit sv_lv3_unit_lt {{if v.isact==1}}active{{/if}}" id="sv_lv3_unit{{v.smalltypeid}}" '
            + ' data-bigtypeid="{{v.bigtypeid}}"  data-bigtypename="{{v.bigtypename}}" data-midtypeid="{{v.midtypeid}}" data-midtypename="{{v.midtypename}}"'
            + ' data-smalltypeid="{{v.smalltypeid}}" data-smalltypename="{{v.smalltypename}}"'
            + '<i class="check circle icon"></i>'
            + '<span class="midtypeid">{{v.midtypeid}}</span>'
            + '-'
            + '<span class="smalltypeid">{{v.smalltypeid}}</span>'
            + '-'
            + '<div class="sv_lv3_unit_name">{{v.smalltypename}}{{isact}}</div>'
            + '</div>{{/each}}';
        var _render = template.compile(_tpl);
        var _html = _render(data);
        $('#goods_sv_selc_dlg .sv_type_cont_left').html(_html);
    },
    // 商标服务三级查询 鼠标点击后触发
    brand_checkLv3_func: function(searchKey,_this){
        var self = this;
        console.log(this.brand_lv3_obj)
        var _url = self.urlLink.brand_svLv3_classify;
        var _param = {
            searchKey: searchKey,
            id: _this.parents('.form_unit_line').prev().find('.classify_store').val(),
        };
        var succ = function(res){
            if(res.code == 0){
                if(res.data.length==0){
                    layer.msg('无匹配结果！',{time: 1000});
                    return;
                }
                self.brand_lv3_obj = {}; //初始化选中数据

                var _tpl='';
                //获取页面上选择数据，这是已有的数据，需要添加新的数据
                var _els = _this.parents('.sv_3lv_btn_grp').find('.sv_btn_unit');
                var _elsData = {};
                _els.each(function(index,value){
                    var bigtypeid = $(this).attr('data-bigtypeid');
                    var bigtypename = $(this).attr('data-bigtypename');
                    var midtypeid = $(this).attr('data-midtypeid');
                    var midtypename = $(this).attr('data-midtypename');
                    var smalltypeid = $(this).attr('data-smalltypeid');
                    var smalltypename = $(this).attr('data-smalltypename');
                    if(_elsData[midtypeid] == undefined) {
                        _elsData[midtypeid] = [];
                        _elsData[midtypeid].push({
                            bigtypeid: bigtypeid,
                            bigtypename: bigtypename,
                            midtypeid: midtypeid,
                            midtypename: midtypename,
                            smalltypeid: smalltypeid,
                            smalltypename: smalltypename
                        })
                    } else {
                        _elsData[midtypeid].push({
                            bigtypeid: bigtypeid,
                            bigtypename: bigtypename,
                            midtypeid: midtypeid,
                            midtypename: midtypename,
                            smalltypeid: smalltypeid,
                            smalltypename: smalltypename
                        })
                    }
                });
                console.log(self.brand_lv3_obj)
                //  将_elsData中的数据合并到self.brand_lv3_obj中
                $.each(_elsData,function(index, data){

                    if(self.brand_lv3_obj.hasOwnProperty(index)) {
                        self.brand_lv3_obj[index] = commonFunc.arrayMerge(self.brand_lv3_obj[index], data)
                    } else {
                        self.brand_lv3_obj[index] = data;
                    }
                });
                console.log(self.brand_lv3_obj)
                // 筛选 添加状态
                var resData = res;
                for(var i = 0; i<resData.data.length; i++) {
                    var val = resData.data[i];
                    resData.data[i].isact = 0;
                    var _thismidbdlt = _elsData[val.midtypeid];
                    if (_thismidbdlt!=undefined){
                        for(var j = 0; j < _thismidbdlt.length; j++) {
                            if(_thismidbdlt[j].smalltypeid == val.smalltypeid && _thismidbdlt[j].smalltypename == val.smalltypename && _thismidbdlt[j].midtypeid == val.midtypeid) {
                                resData.data[i].isact=1;
                                if(self.brand_lv3_obj[val.midtypeid]==undefined){
                                    self.brand_lv3_obj[val.midtypeid]=[];
                                    self.brand_lv3_obj[val.midtypeid].push({
                                        bigtypeid: val.bigtypeid,
                                        bigtypename: val.bigtypename,
                                        midtypename: val.midtypename,
                                        smalltypeid: val.smalltypeid,
                                        smalltypename: val.smalltypename
                                    });
                                } else {
                                }
                            }
                        }
                    }
                }
                console.log(self.brand_lv3_obj)
                //左侧数据渲染
                self.brandlv3_rmenu_render(resData);
                console.log(self.brand_lv3_obj)

                if(!commonFunc.isEmptyObject(_elsData)){
                    self.update_seleclv3(_this);
                }

                self.brand_check_dlg_evbind(_this);
            }
            else if (res.code==9999)
            {
                layer.msg(res.msg,{time: 1000});
                wzERP.Common.TimeoutLogin();
            }
            else{
                layer.msg(res.msg,{time: 1000});
            }

        }
        commonFunc.ajax_get(_url,_param,succ,{contentType: 'application/x-www-form-urlencoded'});
    },
    brand_check_dlg_evbind: function(_this){
        var self = this;
        var _pel = $('#goods_sv_selc_dlg');
        // 左侧菜单点击事件绑定
        _pel.find('.sv_lv3_unit_lt').off('click').on('click',function(){
            var bigtypeid = $(this).attr('data-bigtypeid');
            var bigtypename = $(this).attr('data-bigtypename');
            var midtypeid = $(this).attr('data-midtypeid');
            var midtypename = $(this).attr('data-midtypename');
            var smalltypeid = $(this).attr('data-smalltypeid');
            var smalltypename = $(this).attr('data-smalltypename');
            if(!$(this).hasClass('active')){
                // 添加
                $(this).addClass('active');
                if(self.brand_lv3_obj[midtypeid]!=undefined){
                    self.brand_lv3_obj[midtypeid].push({
                        bigtypeid: bigtypeid,
                        bigtypename: bigtypename,
                        midtypeid: midtypeid,
                        midtypename: midtypename,
                        smalltypeid: smalltypeid,
                        smalltypename: smalltypename,
                    });
                }else{
                    self.brand_lv3_obj[midtypeid] = [];
                    self.brand_lv3_obj[midtypeid].push({
                        bigtypeid: bigtypeid,
                        bigtypename: bigtypename,
                        midtypeid: midtypeid,
                        midtypename: midtypename,
                        smalltypeid: smalltypeid,
                        smalltypename: smalltypename,
                    });
                }

                var _html = '<span class="sv_btn_unit" id="sv_btn_un' + midtypeid + '_' + smalltypeid
                    + '" data-bigtypeid="' + bigtypeid + '" data-bigtypename="' + bigtypename
                    + '" data-midtypeid="' + midtypeid + '" data-midtypename="' + midtypename
                    + '" data-smalltypeid="' + smalltypeid + '" data-smalltypename="' + smalltypename
                    + '"><span>'
                    + midtypeid + '</span>-<span>' + smalltypeid +'</span>-<span class="smalltypename">' + smalltypename+'</span></span>'
                $(".sv_3lv_btn_grp ").append(_html);
            }else{
                // 移除
                $(this).removeClass('active');
                for (var i = 0; i < self.brand_lv3_obj[midtypeid].length; i++) {
                    if (self.brand_lv3_obj[midtypeid][i]['smalltypeid'] == smalltypeid && self.brand_lv3_obj[midtypeid][i]['smalltypename'] == smalltypename) {
                        self.brand_lv3_obj[midtypeid].splice(i, 1)
                    }
                }
                if (self.brand_lv3_obj[midtypeid].length == 0) {
                    delete self.brand_lv3_obj[midtypeid];
                }
                _this.parent().find('#sv_btn_un' + midtypeid + '_' + smalltypeid).remove();
            }
            self.update_seleclv3(_this);

            _this.parent().find('.sv_btn_unit').on('click',function(){
                $(this).remove();
                var midtypeid = $(this).attr('data-midtypeid');
                var smalltypeid = $(this).attr('data-smalltypeid');
                var smalltypename = $(this).find('.smalltypename').html().trim();
                $.each(self.brand_lv3_obj, function(index, value){
                    for(var i =0; i< value.length; i++){
                        if(midtypeid == value[i].midtypeid && smalltypeid == value[i].smalltypeid && smalltypename == value[i].smalltypename) {
                            value.splice(i,1)
                        }
                    }
                    if(value.length == 0){
                        delete self.brand_lv3_obj[index]
                    }
                })
                console.log(self.brand_lv3_obj)
            })

        })
        // 提交绑定
        _pel.find('.sv_lv3_submit').off('click').on('click',function(){
            var _html = '',_bdlv3={};
            // 整理搜索数据
            $.each(self.brand_lv3_obj,function(key,value){
                $.each(self.brand_lv3_obj[key],function(ckey,value){
                    _bdlv3[ckey] = {
                        name: value.name,
                        mid: key,
                    };
                })
            });
            // 获取页面元素的 生成数据
            // 待修改
            var _els = _this.parent().find('.sv_btn_unit'),_cache_bdlv3={};
            _els.each(function(index){
                _cache_bdlv3[$(this).data('id')] = {
                    name: $(this).text(),
                    mid: $(this).data('mid'),
                };
            });
            //合并 本次和已选
            $.extend(_bdlv3,_cache_bdlv3);
            //生成页面元素
            _this.parent().find('.sv_btn_unit').remove();

            $.each(self.brand_lv3_obj, function(index, value){

                for(var i = 0; i< value.length; i++) {
                    _html += '<span class="sv_btn_unit" id="sv_btn_un' + index + '_' + value[i].smalltypeid
                        + '" data-bigtypeid="' + value[i].bigtypeid + '" data-bigtypename="' + value[i].bigtypename
                        + '" data-midtypeid="' + value[i].midtypeid + '" data-midtypename="' + value[i].midtypename
                        + '" data-smalltypeid="' + value[i].smalltypeid + '" data-smalltypename="' + value[i].smalltypename
                        + '"><span>'
                        + value[i].midtypeid + '</span>-<span>' + value[i].smalltypeid +'</span>-<span class="smalltypename">' + value[i].smalltypename+'</span></span>'
                }
            })

            $(_html).insertAfter(_this);
            // 页面元素绑定方法
            _this.parent().find('.sv_btn_unit').on('click',function(){
                $(this).remove();
                var midtypeid = $(this).attr('data-midtypeid');
                var smalltypeid = $(this).attr('data-smalltypeid');
                var smalltypename = $(this).find('.smalltypename').html().trim();
                $.each(self.brand_lv3_obj, function(index, value){
                    for(var i =0; i< value.length; i++){
                        if(midtypeid == value[i].midtypeid && smalltypeid == value[i].smalltypeid && smalltypename == value[i].smalltypename) {
                            value.splice(i,1)
                        }
                    }
                    if(value.length == 0){
                        delete self.brand_lv3_obj[index]
                    }
                })
                console.log(self.brand_lv3_obj)
            })
            //关闭弹窗
            $('#goods_sv_selc_dlg').modal('hide');
        })
    },
    //更新服务选中状态 根据 self.brand_lv3_obj, 左侧点击更新右侧显示
    update_seleclv3: function(_this){
        var self = this;
        var _html = '';
        var data = self.brand_lv3_obj;
        console.log(data)
        _html = template('goods_sv_selc_right',data);
        // 右侧点击事件绑定
        $('#goods_sv_selc_dlg .sv_type_cont_right').html(_html).find('.sv_lv3_unit').on('click',function(){
            var bigtypeid = $(this).attr('data-bigtypeid');
            var bigtypename = $(this).attr('data-bigtypename');
            var midtypeid = $(this).attr('data-midtypeid');
            var midtypename = $(this).attr('data-midtypename');
            var smalltypeid = $(this).attr('data-smalltypeid');
            var smalltypename = $(this).attr('data-smalltypename');
            for (var i = 0; i < self.brand_lv3_obj[midtypeid].length; i ++) {
                if(self.brand_lv3_obj[midtypeid][i]['smalltypeid'] == smalltypeid && self.brand_lv3_obj[midtypeid][i]['midtypeid'] == midtypeid && self.brand_lv3_obj[midtypeid][i]['smalltypename'] == smalltypename) {
                    self.brand_lv3_obj[midtypeid].splice(i,1)
                }
            }
            $('#goods_sv_selc_dlg').find('#sv_lv3_unit'+ smalltypeid).removeClass('active');//左侧菜单更新状态
            if(self.brand_lv3_obj[midtypeid].length > 0) {
                $(this).remove();
            }else{
                delete self.brand_lv3_obj[midtypeid];
                $(this).parents('.sv_lv23_selc_grp').remove();
            }
            _this.parents().find('#sv_btn_un'+ midtypeid+'_'+smalltypeid).remove();
        });
    },
    // 商标三级分类dlg 事件绑定
    brand_lv3Dlg_evbind: function(_this){
        var self = this;
        $('#goods_sv_selc_dlg .brand_lv3_classify').off('click').on('click',function(){
            var searchKey = $(this).prev().val();
            self.brand_checkLv3_func(searchKey,_this);
        }).trigger('click');
    },
    //city-picker填值  提交用 self.city_picker_form_data_set()
    city_picker_form_data_set: function(){
        $('.region_picker_ip').each(function(index,el){
            var _areaEl = $(this).next().find('.select-item');
            var _areaIp = $(this).parent().find('.region_unit_ip');
            _areaIp.each(function(index, el) {
                $(this).val('');//清除原值
                if(index+1>_areaEl.length) return false;
                $(this).val(_areaEl.eq(index).data('code'));
            });
        })
    },
    // component----------

    buildTrademarkRegist: function () {
        if ($('.trademark_regist_form').length == 0) {
            return null;
        }
        var trademarkRegist = {};
        trademarkRegist.id = $('.trademark_regist_form input[name=id]').val();
        trademarkRegist.did = $('.trademark_regist_form input[name=did]').val();
        trademarkRegist.trademarkName = $('.trademark_regist_form input[name=trademarkName]').val();
        trademarkRegist.caseCode = $('.trademark_regist_form input[name=caseCode]').val();
        trademarkRegist.serviceId = $('.trademark_regist_form input[name=serviceId]').val();
        trademarkRegist.serviceCode = $('.trademark_regist_form input[name=serviceCode]').val();
        trademarkRegist.businessCode = $('.trademark_regist_form input[name=businessCode]').val();
        trademarkRegist.custId = $('.trademark_regist_form input[name=custId]').val();
        trademarkRegist.custName = $('.trademark_regist_form input[name=custName]').val();
        trademarkRegist.proposerType = $('.trademark_regist_form input[name=proposerType]:checked').val();
        trademarkRegist.provinceCode = $('.trademark_regist_form input[name=provinceCode]').siblings('span.city-picker-span').find('span[data-count=province]').attr('data-code');
        trademarkRegist.cityCode = $('.trademark_regist_form input[name=cityCode]').siblings('span.city-picker-span').find('span[data-count=city]').attr('data-code');
        trademarkRegist.county = $('.trademark_regist_form input[name=county]').siblings('span.city-picker-span').find('span[data-count=district]').attr('data-code');
        trademarkRegist.applyAddress = $('.trademark_regist_form input[name=applyAddress]').val();
        trademarkRegist.businessLicence = $('.trademark_regist_form input[name=businessLicence]').val();
        trademarkRegist.businessLicenceUrl = $('.trademark_regist_form input[name=businessLicenceUrl]').val();
        trademarkRegist.contactName = $('.trademark_regist_form input[name=contactName]').val();
        trademarkRegist.contactPhone = $('.trademark_regist_form input[name=contactPhone]').val();
        trademarkRegist.trademarkName = $('.trademark_regist_form input[name=trademarkName]').val();
        trademarkRegist.trademarkType = $('.trademark_regist_form input[name=trademarkType]:checked').val();
        trademarkRegist.trademarkKind = $('.trademark_regist_form input[name=trademarkKind]:checked').val();
        trademarkRegist.trademarkUrl = $('.trademark_regist_form input[name=trademarkUrl]').val();
        trademarkRegist.specifiedColor = $('.trademark_regist_form input[name=specifiedColor]:checked').val();
        trademarkRegist.internationClassCode = $('.trademark_regist_form input[name=internationClassCode]').val();
        trademarkRegist.internationClassName = $('.trademark_regist_form input[name=internationClassName]').val();
        trademarkRegist.internationDetail = $('.trademark_regist_form input[name=internationDetail]').val();
        trademarkRegist.powerAttorney = $('.trademark_regist_form input[name=powerAttorney]').val();
        trademarkRegist.description = $('.trademark_regist_form .description').val();
        trademarkRegist.confirmApplyUrl = $('.trademark_regist_form input[name=confirmApplyUrl]').val();
        trademarkRegist.riskNoticeUrl = $('.trademark_regist_form input[name=riskNoticeUrl]').val();
        trademarkRegist.legalIdcard =  $('.trademark_regist_form input[name=legalIdcard]').val();
        trademarkRegist.legalIdcardUrl = $('.trademark_regist_form input[name=legalIdcardUrl]').val();
        var resultInternationDetailArr = [];
        $('.sv_3lv_btn_grp span.sv_btn_unit').each(function(){
            resultInternationDetailArr.push({
                bigtypeid: $(this).attr('data-bigtypeid'),
                bigtypename: $(this).attr('data-bigtypename'),
                midtypeid: $(this).attr('data-midtypeid'),
                midtypename: $(this).attr('data-midtypename'),
                smalltypeid: $(this).attr('data-smalltypeid'),
                smalltypename: $(this).attr('data-smalltypename'),
            });
        });
        trademarkRegist.internationDetailList = resultInternationDetailArr;
        return trademarkRegist;
    },
    buildTrademarkLicence: function () {
        if ($('.trademark_licence_from').length == 0) {
            return null;
        }
        var trademarkLicens = {};
        trademarkLicens.id = $('.trademark_licence_from input[name=id]').val();
        trademarkLicens.did = $('.trademark_licence_from input[name=did]').val();
        trademarkLicens.trademarkName = $('.trademark_licence_from input[name=trademarkName]').val();
        trademarkLicens.caseCode = $('.trademark_licence_from input[name=caseCode]').val();
        trademarkLicens.serviceClassificationId = $('.trademark_licence_from input[name=serviceClassificationId]').val();
        trademarkLicens.serviceCode = $('.trademark_licence_from input[name=serviceCode]').val();
        trademarkLicens.businessCode = $('.trademark_licence_from input[name=businessCode]').val();
        trademarkLicens.businessId = $('.trademark_licence_from input[name=businessId]').val();
        trademarkLicens.nationality = $('.trademark_licence_from select[name=nationality] option:selected').val();
        trademarkLicens.internationClassCode = $('.trademark_licence_from input[name=internationClassCode]').val();
        trademarkLicens.licenceNationality = $('.trademark_licence_from select[name=licenceNationality] option:selected').val();
        trademarkLicens.custName = $('.trademark_licence_from input[name=custName]').val();
        trademarkLicens.proposerType = $('.trademark_licence_from input[name=proposerType]:checked').val();
        trademarkLicens.trademarkCode = $('.trademark_licence_from input[name=trademarkCode]').val();
        trademarkLicens.trademarkKind = $('.trademark_licence_from input[name=trademarkKind]:checked').val();
        trademarkLicens.shareTrademark = $('.trademark_licence_from input[name=shareTrademark]:checked').val();
        trademarkLicens.name = $('.trademark_licence_from input[name=name]').val();
        trademarkLicens.provinceCode = $('.trademark_licence_from input[name=provinceCode]').siblings('span.city-picker-span').find('span[data-count=province]').attr('data-code');
        trademarkLicens.cityCode = $('.trademark_licence_from input[name=cityCode]').siblings('span.city-picker-span').find('span[data-count=city]').attr('data-code');
        trademarkLicens.county = $('.trademark_licence_from input[name=county]').siblings('span.city-picker-span').find('span[data-count=district]').attr('data-code');
        trademarkLicens.provinceName = $('.trademark_licence_from input[name=provinceName]').val();
        trademarkLicens.cityName = $('.trademark_licence_from input[name=cityName]').val();
        trademarkLicens.countyName = $('.trademark_licence_from input[name=countyName]').val();
        trademarkLicens.address = $('.trademark_licence_from input[name=address]').val();
        trademarkLicens.certificateUrl = $('.trademark_licence_from input[name=certificateUrl]').val();
        trademarkLicens.licenceProposerType = $('.trademark_licence_from input[name=licenceProposerType]:checked').val();
        trademarkLicens.contactName = $('.trademark_licence_from input[name=contactName]').val();
        trademarkLicens.contactPhone = $('.trademark_licence_from input[name=contactPhone]').val();
        trademarkLicens.postalCode = $('.trademark_licence_from input[name=postalCode]').val();
        trademarkLicens.trademarkUrl = $('.trademark_licence_from input[name=trademarkUrl]').val();
        trademarkLicens.powerAttorney = $('.trademark_licence_from input[name=powerAttorney]').val();
        return trademarkLicens;
    },
    buildTrademarkChange: function () {
        if ($('.trademark_change_form').length == 0) {
            return null;
        }
        var trademarkChange = {};
        trademarkChange.id = $('.trademark_change_form input[name=id]').val();
        trademarkChange.did = $('.trademark_change_form input[name=did]').val();
        trademarkChange.trademarkName = $('.trademark_change_form input[name=trademarkName]').val();
        trademarkChange.trademarkCode = $('.trademark_change_form input[name=trademarkCode]').val();
        trademarkChange.caseCode = $('.trademark_change_form input[name=caseCode]').val();
        trademarkChange.serviceClassificationId = $('.trademark_change_form input[name=serviceClassificationId]').val();
        trademarkChange.serviceCode = $('.trademark_change_form input[name=serviceCode]').val();
        trademarkChange.businessCode = $('.trademark_change_form input[name=businessCode]').val();
        trademarkChange.businessId = $('.trademark_change_form input[name=businessId]').val();
        trademarkChange.internationClassCode = $('.trademark_change_form input[name=internationClassCode]').val();
        trademarkChange.nationality = $('.trademark_change_form select[name=nationality] option:selected').val();
        trademarkChange.changeType = $('.trademark_change_form select[name=changeType] option:selected').val();
        trademarkChange.custName = $('.trademark_change_form input[name=custName]').val();
        trademarkChange.proposerType = $('.trademark_change_form input[name=proposerType]:checked').val();
        trademarkChange.trademarkKind = $('.trademark_change_form input[name=trademarkKind]:checked').val();
        trademarkChange.shareTrademark = $('.trademark_change_form input[name=shareTrademark]:checked').val();
        trademarkChange.contactName = $('.trademark_change_form input[name=contactName]').val();
        trademarkChange.contactPhone = $('.trademark_change_form input[name=contactPhone]').val();
        trademarkChange.trademarkUrl = $('.trademark_change_form input[name=trademarkUrl]').val();
        trademarkChange.postalCode = $('.trademark_change_form input[name=postalCode]').val();
        trademarkChange.powerAttorney = $('.trademark_change_form input[name=powerAttorney]').val();
        trademarkChange.registerList = [];
        trademarkChange.proxyer = {};
        trademarkChange.licencer = {};
        console.log($('.case_unit .register_form').length)
        $('.case_unit .register_form .register_form_content').each(function () {
            var id =  $(this).find('input[name=id]').val();
            var namePre = $(this).find('input[name=namePre]').val();
            var provinceCodePre = $(this).find('input[name=provinceCodePre]').siblings('span.city-picker-span').find('span[data-count=province]').attr('data-code');
            var cityCodePre = $(this).find('input[name=cityCodePre]').siblings('span.city-picker-span').find('span[data-count=city]').attr('data-code');
            var countyPre = $(this).find('input[name=countyPre]').siblings('span.city-picker-span').find('span[data-count=district]').attr('data-code');
            var addressPre = $(this).find('input[name=addressPre]').val();
            var nameAfter = $(this).find('input[name=nameAfter]').val();
            var provinceCodeAfter = $(this).find('input[name=provinceCodeAfter]').siblings('span.city-picker-span').find('span[data-count=province]').attr('data-code');
            var cityCodeAfter = $(this).find('input[name=cityCodeAfter]').siblings('span.city-picker-span').find('span[data-count=city]').attr('data-code');
            var countyAfter = $(this).find('input[name=countyAfter]').siblings('span.city-picker-span').find('span[data-count=district]').attr('data-code');
            var addressAfter = $(this).find('input[name=addressAfter]').val();
            var certificateUrl = $(this).find('input[name=certificateUrl]').val();
            var alterProveUrl = $(this).find('input[name=alterProveUrl]').val();
            if (case_page.isEmpty(id)  && case_page.isEmpty(namePre) && case_page.isEmpty(provinceCodePre) && case_page.isEmpty(cityCodePre) && case_page.isEmpty(countyPre) && case_page.isEmpty(addressPre) &&
                case_page.isEmpty(nameAfter) && case_page.isEmpty(provinceCodeAfter) && case_page.isEmpty(cityCodeAfter) && case_page.isEmpty(countyAfter) && case_page.isEmpty(addressAfter) && case_page.isEmpty(certificateUrl) && case_page.isEmpty(alterProveUrl)) {
            } else {
                trademarkChange.registerList.push({
                    id: id,
                    namePre: namePre,
                    provinceCodePre: provinceCodePre,
                    cityCodePre: cityCodePre,
                    countyPre: countyPre,
                    addressPre: addressPre,
                    nameAfter: nameAfter,
                    provinceCodeAfter: provinceCodeAfter,
                    cityCodeAfter: cityCodeAfter,
                    countyAfter: countyAfter,
                    addressAfter: addressAfter,
                    certificateUrl: certificateUrl,
                    alterProveUrl: alterProveUrl,
                });
            }
        })
        trademarkChange.proxyer.namePre = $('.case_unit .proxyer_form input[name=namePre]').val();
        trademarkChange.proxyer.provinceCodePre = $('.case_unit .proxyer_form input[name=provinceCodePre]').siblings('span.city-picker-span').find('span[data-count=province]').attr('data-code');
        trademarkChange.proxyer.cityCodePre = $('.case_unit .proxyer_form input[name=cityCodePre]').siblings('span.city-picker-span').find('span[data-count=city]').attr('data-code');
        trademarkChange.proxyer.countyPre = $('.case_unit .proxyer_form input[name=countyPre]').siblings('span.city-picker-span').find('span[data-count=district]').attr('data-code');
        trademarkChange.proxyer.addressPre = $('.case_unit .proxyer_form input[name=addressPre]').val();
        trademarkChange.proxyer.fileReceiverPre = $('.case_unit .proxyer_form input[name=fileReceiverPre]').val();
        trademarkChange.proxyer.nameAfter = $('.case_unit .proxyer_form input[name=nameAfter]').val();
        trademarkChange.proxyer.provinceCodeAfter = $('.case_unit .proxyer_form input[name=provinceCodeAfter]').siblings('span.city-picker-span').find('span[data-count=province]').attr('data-code');
        trademarkChange.proxyer.cityCodeAfter = $('.case_unit .proxyer_form input[name=cityCodeAfter]').siblings('span.city-picker-span').find('span[data-count=city]').attr('data-code');
        trademarkChange.proxyer.countyAfter = $('.case_unit .proxyer_form input[name=countyAfter]').siblings('span.city-picker-span').find('span[data-count=district]').attr('data-code');
        trademarkChange.proxyer.addressAfter = $('.case_unit .proxyer_form input[name=addressAfter]').val();
        trademarkChange.proxyer.fileReceiverAfter = $('.case_unit .proxyer_form input[name=fileReceiverAfter]').val();
        trademarkChange.proxyer.postalCodePre = $('.case_unit .proxyer_form input[name=postalCodePre]').val();
        trademarkChange.proxyer.postalCodeAfter = $('.case_unit .proxyer_form input[name=postalCodeAfter]').val();

        trademarkChange.licencer.recordCode = $('.case_unit .licensor_form input[name=recordCode]').val()
        trademarkChange.licencer.licensorName = $('.case_unit .licensor_form input[name=licensorName]').val();
        trademarkChange.licencer.asLicensorName = $('.case_unit .licensor_form input[name=asLicensorName]').val();
        trademarkChange.licencer.certificateUrl = $('.case_unit .licensor_form input[name=certificateUrl]').val();
        trademarkChange.licencer.alterProveUrl = $('.case_unit .licensor_form input[name=alterProveUrl]').val();
        return trademarkChange;
    },
    buildTrademarkExtend: function () {
        if ($('.trademark_extend_form').length == 0) {
            return null;
        }
        var trademarkExtend = {};
        trademarkExtend.id = $('.trademark_extend_form input[name=id]').val();
        trademarkExtend.did = $('.trademark_extend_form input[name=did]').val();
        trademarkExtend.trademarkName = $('.trademark_extend_form input[name=trademarkName]').val();
        trademarkExtend.caseCode = $('.trademark_extend_form input[name=caseCode]').val();
        trademarkExtend.serviceClassificationId = $('.trademark_extend_form input[name=serviceClassificationId]').val();
        trademarkExtend.serviceCode = $('.trademark_extend_form input[name=serviceCode]').val();
        trademarkExtend.businessCode = $('.trademark_extend_form input[name=businessCode]').val();
        trademarkExtend.businessId = $('.trademark_extend_form input[name=businessId]').val();
        trademarkExtend.nationality = $('.trademark_extend_form select[name=nationality] option:selected').val();
        trademarkExtend.internationClassCode = $('.trademark_extend_form input[name=internationClassCode]').val();
        trademarkExtend.trademarkCode = $('.trademark_extend_form input[name=trademarkCode]').val();
        trademarkExtend.trademarkKind = $('.trademark_extend_form input[name=trademarkKind]:checked').val();
        trademarkExtend.shareTrademark = $('.trademark_extend_form input[name=shareTrademark]:checked').val();
        trademarkExtend.bussnessType = $('.trademark_extend_form input[name=bussnessType]:checked').val();
        trademarkExtend.proposerType = $('.trademark_extend_form input[name=proposerType]:checked').val();
        trademarkExtend.contactName = $('.trademark_extend_form input[name=contactName]').val();
        trademarkExtend.contactPhone = $('.trademark_extend_form input[name=contactPhone]').val();
        trademarkExtend.postalCode = $('.trademark_extend_form input[name=postalCode]').val();
        trademarkExtend.trademarkUrl = $('.trademark_extend_form input[name=trademarkUrl]').val();
        trademarkExtend.powerAttorney = $('.trademark_extend_form input[name=powerAttorney]').val();
        return trademarkExtend;
    },
    buildTrademarkCertificate: function () {
        if ($('.trademark_certificate_form').length == 0) {
            return null;
        }
        var trademarkCertificate = {};
        trademarkCertificate.id = $('.trademark_certificate_form input[name=id]').val();
        trademarkCertificate.did = $('.trademark_certificate_form input[name=did]').val();
        trademarkCertificate.trademarkName = $('.trademark_certificate_form input[name=trademarkName]').val();
        trademarkCertificate.caseCode = $('.trademark_certificate_form input[name=caseCode]').val();
        trademarkCertificate.serviceClassificationId = $('.trademark_certificate_form input[name=serviceClassificationId]').val();
        trademarkCertificate.serviceCode = $('.trademark_certificate_form input[name=serviceCode]').val();
        trademarkCertificate.businessCode = $('.trademark_certificate_form input[name=businessCode]').val();
        trademarkCertificate.businessId = $('.trademark_certificate_form input[name=businessId]').val();
        trademarkCertificate.nationality = $('.trademark_certificate_form select[name=nationality] option:selected').val();
        trademarkCertificate.internationClassCode = $('.trademark_certificate_form input[name=internationClassCode]').val();
        trademarkCertificate.trademarkCode = $('.trademark_certificate_form input[name=trademarkCode]').val();
        trademarkCertificate.trademarkKind = $('.trademark_certificate_form input[name=trademarkKind]:checked').val();
        trademarkCertificate.shareTrademark = $('.trademark_certificate_form input[name=shareTrademark]:checked').val();
        trademarkCertificate.causeDescript = $('.trademark_certificate_form textarea[name=causeDescript]').val();
        trademarkCertificate.proposerType = $('.trademark_certificate_form input[name=proposerType]:checked').val();
        trademarkCertificate.contactName = $('.trademark_certificate_form input[name=contactName]').val();
        trademarkCertificate.contactPhone = $('.trademark_certificate_form input[name=contactPhone]').val();
        trademarkCertificate.postalCode = $('.trademark_certificate_form input[name=postalCode]').val();
        trademarkCertificate.trademarkUrl = $('.trademark_certificate_form input[name=trademarkUrl]').val();
        trademarkCertificate.powerAttorney = $('.trademark_certificate_form input[name=powerAttorney]').val();
        return trademarkCertificate;
    },
    buildTrademarkTransfer: function () {
        if ($('.trademark_transfer_form').length == 0) {
            return null;
        }
        var trademarkTransfer = {};
        trademarkTransfer.id = $('.trademark_transfer_form input[name=id]').val();
        trademarkTransfer.did = $('.trademark_transfer_form input[name=did]').val();
        trademarkTransfer.trademarkName = $('.trademark_transfer_form input[name=trademarkName]').val();
        trademarkTransfer.caseCode = $('.trademark_transfer_form input[name=caseCode]').val();
        trademarkTransfer.serviceClassificationId = $('.trademark_transfer_form input[name=serviceClassificationId]').val();
        trademarkTransfer.serviceCode = $('.trademark_transfer_form input[name=serviceCode]').val();
        trademarkTransfer.businessCode = $('.trademark_transfer_form input[name=businessCode]').val();
        trademarkTransfer.businessId = $('.trademark_transfer_form input[name=businessId]').val();
        trademarkTransfer.internationClassCode = $('.trademark_transfer_form input[name=internationClassCode]').val();
        trademarkTransfer.nationality = $('.trademark_transfer_form select[name=nationality] option:selected').val();
        trademarkTransfer.proposerType = $('.trademark_transfer_form input[name=proposerType]:checked').val();
        trademarkTransfer.trademarkKind = $('.trademark_transfer_form input[name=trademarkKind]:checked').val();
        trademarkTransfer.shareTrademark = $('.trademark_transfer_form input[name=shareTrademark]:checked').val();
        trademarkTransfer.contactName = $('.trademark_transfer_form input[name=contactName]').val();
        trademarkTransfer.contactPhone = $('.trademark_transfer_form input[name=contactPhone]').val();
        trademarkTransfer.trademarkUrl = $('.trademark_transfer_form input[name=trademarkUrl]').val();
        trademarkTransfer.postalCode = $('.trademark_transfer_form input[name=postalCode]').val();
        trademarkTransfer.trademarkCode = $('.trademark_transfer_form input[name=trademarkCode]').val();
        trademarkTransfer.powerAttorney = $('.trademark_transfer_form input[name=powerAttorney]').val();
        trademarkTransfer.contactList = [];
        console.log($('.case_unit .contact_form_content').length)
        $('.case_unit .contact_form_content').each(function () {
            var id =   $(this).find('input[name=id]').val();
            var nationality = $(this).find('select[name=nationality] option:selected').val();
            var proposerType = $(this).find('input[name=proposerType]:checked').val();
            var contactName = $(this).find('input[name=contactName]').val();
            var provinceCode = $(this).find('input[name=provinceCode]').siblings('span.city-picker-span').find('span[data-count=province]').attr('data-code');
            var cityCode = $(this).find('input[name=cityCode]').siblings('span.city-picker-span').find('span[data-count=city]').attr('data-code');
            var county = $(this).find('input[name=county]').siblings('span.city-picker-span').find('span[data-count=district]').attr('data-code');
            var provinceName = $(this).find('input[name=provinceName]').val();
            var cityName = $(this).find('input[name=cityName]').val();
            var countyName = $(this).find('input[name=countyName]').val();
            var address = $(this).find('input[name=address]').val();
            var certificateUrl = $(this).find('input[name=certificateUrl]').val();
            if (case_page.isEmpty(id)  && case_page.isEmpty(proposerType) && case_page.isEmpty(contactName) && case_page.isEmpty(provinceName) && case_page.isEmpty(cityName) && case_page.isEmpty(countyName) && case_page.isEmpty(address) && case_page.isEmpty(certificateUrl)) {
            } else {
                trademarkTransfer.contactList.push({
                    id: id,
                    nationality: nationality,
                    proposerType: proposerType,
                    contactName: contactName,
                    provinceCode: provinceCode,
                    cityCode: cityCode,
                    county: county,
                    provinceName: provinceName,
                    cityName: cityName,
                    countyName: countyName,
                    address: address,
                    certificateUrl: certificateUrl,
                });
            }
        })
        return trademarkTransfer;
    },
    validateTrademarkRegist: function (obj) {
        var errorObj = {};
        var errorMsg = new Array();
        var currentErrorMsg = [];
        console.log(obj)
        if (this.isEmpty(obj.proposerType)) {
            errorMsg.push({
                'name': 'proposerType',
                'msg': '请选择申请人类型',
            });
            currentErrorMsg.push('请选择申请人类型');
        }
        if (this.isEmpty(obj.custName)) {
            errorMsg.push({
                'name': 'custName',
                'msg': '请输入申请人名称',
            });
            currentErrorMsg.push('请输入申请人名称');
        }
        if (this.isEmpty(obj.provinceCode) || this.isEmpty(obj.cityCode) || this.isEmpty(obj.county) || this.isEmpty(obj.applyAddress)) {
            errorMsg.push({
                'name': 'address',
                'msg': '请输入申请人详细地址',
            });
            currentErrorMsg.push('请输入申请人详细地址');
        }
        // if (this.isEmpty(obj.businessLicence)) {
        //     errorMsg.push({
        //         'name': 'businessLicence',
        //         'msg': '请输入营业执照',
        //     });
        //     currentErrorMsg.push('请输入营业执照');
        // }
        // if (this.isEmpty(obj.businessLicenceUrl)) {
        //     errorMsg.push({
        //         'name': 'businessLicenceUrl',
        //         'msg': '请上传营业执照',
        //     });
        //     currentErrorMsg.push('请上传营业执照');
        // }
        if (this.isEmpty(obj.contactName)) {
            errorMsg.push({
                'name': 'contactName',
                'msg': '请输入联系人姓名',
            });
            currentErrorMsg.push('请输入联系人姓名');
        }
        if (this.isEmpty(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhone',
                'msg': '请输入联系人电话',
            });
            currentErrorMsg.push('请输入联系人电话');
        }
        if (!this.isPhoneNumber(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhoneFormat',
                'msg': '请输入正确的电话号码',
            });
            currentErrorMsg.push('请输入正确的电话号码');
        }
        // if(this.isEmpty(obj.trademarkName)) {
        //     errorMsg.push({
        //         'name': 'trademarkName',
        //         'msg':  '商标名称不能为空',
        //     });
        //     currentErrorMsg = '商标名称不能为空';
        // }
        if (this.isEmpty(obj.trademarkType)) {
            errorMsg.push({
                'name': 'trademarkType',
                'msg': '请选择商标类型',
            });
            currentErrorMsg.push('请选择商标类型');
        }
        if (this.isEmpty(obj.trademarkKind)) {
            errorMsg.push({
                'name': 'trademarkKind',
                'msg': '请选择商标种类',
            });
            currentErrorMsg.push('请选择商标种类');
        }
        if (this.isEmpty(obj.trademarkUrl)) {
            errorMsg.push({
                'name': 'trademarkUrl',
                'msg': '请上传商标图样',
            });
            currentErrorMsg.push('请上传商标图样');
        }
        if (this.isEmpty(obj.specifiedColor)) {
            errorMsg.push({
                'name': 'specifiedColor',
                'msg': '请选择是否指定颜色',
            });
            currentErrorMsg.push('请选择是否指定颜色');
        }
        errorObj.errorMsg = errorMsg;
        errorObj.currentErrorMsg = currentErrorMsg;
        return errorObj;
    },
    validateTrademarkLicence: function (obj) {
        var errorObj = {};
        var errorMsg = new Array();
        var currentErrorMsg = [];
        console.log(obj)
        if (this.isEmpty(obj.trademarkCode)) {
            errorMsg.push({
                'name': 'trademarkCode',
                'msg': '请输入商标注册号',
            });
            currentErrorMsg.push('请输入商标注册号');
        }
        if (this.isEmpty(obj.trademarkName)) {
            errorMsg.push({
                'name': 'trademarkName',
                'msg': '请输入商标名称',
            });
            currentErrorMsg.push('请输入商标名称');
        }
        if (this.isEmpty(obj.internationClassCode)) {
            errorMsg.push({
                'name': 'internationClassCode',
                'msg': '请输入国际分类',
            });
            currentErrorMsg.push('请输入国际分类');
        }
        // if(this.isEmpty(obj.trademarkKind)) {
        //     errorMsg.push({
        //         'name': 'trademarkKind',
        //         'msg':  '请选择商标种类',
        //     });
        //     currentErrorMsg.push('请选择商标种类';
        // }
        // if(this.isEmpty(obj.shareTrademark)) {
        //     errorMsg.push({
        //         'name': 'shareTrademark',
        //         'msg':  '请选择是否共有商标',
        //     });
        //     currentErrorMsg.push('请选择是否共有商标';
        // }
        //
        // if(this.isEmpty(obj.nationality)) {
        //     errorMsg.push({
        //         'name': 'nationality',
        //         'msg':  '请选择注册人国籍',
        //     });
        //     currentErrorMsg.push('请选择注册人国籍';
        // }
        //
        // if(this.isEmpty(obj.proposerType)) {
        //     errorMsg.push({
        //         'name': 'proposerType',
        //         'msg':  '请选择注册人类型',
        //     });
        //     currentErrorMsg.push('请选择注册人类型';
        // }
        // if(this.isEmpty(obj.licenceNationality)) {
        //     errorMsg.push({
        //         'name': 'licenceNationality',
        //         'msg':  '请选择被许可人国籍',
        //     });
        //     currentErrorMsg.push('请选择被许可人国籍';
        // }
        // if(this.isEmpty(obj.licenceProposerType)) {
        //     errorMsg.push({
        //         'name': 'licenceProposerType',
        //         'msg':  '请选择被许可人类型',
        //     });
        //     currentErrorMsg.push('请选择被许可人类型';
        // }
        if (this.isEmpty(obj.name)) {
            errorMsg.push({
                'name': 'name',
                'msg': '请输入被许可人名称',
            });
            currentErrorMsg.push('请输入被许可人名称');
        }
        if (this.isEmpty(obj.provinceCode) || this.isEmpty(obj.cityCode) || this.isEmpty(obj.county) || this.isEmpty(obj.address)) {
            errorMsg.push({
                'name': 'address',
                'msg': '请输入被许可人详细地址',
            });
            currentErrorMsg.push('请输入被许可人详细地址');
        }
        // if(this.isEmpty(obj.certificateUrl)) {
        //     errorMsg.push({
        //         'name': 'certificateUrl',
        //         'msg':  '请上传被许可人证照',
        //     });
        //     currentErrorMsg.push('请上传被许可人证照');
        // }
        if (this.isEmpty(obj.contactName)) {
            errorMsg.push({
                'name': 'contactName',
                'msg': '请输入联系人姓名',
            });
            currentErrorMsg.push('请输入联系人姓名');
        }
        if (this.isEmpty(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhone',
                'msg': '请输入联系人电话',
            });
            currentErrorMsg.push('请输入联系人电话');
        }
        if (!this.isPhoneNumber(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhoneFormat',
                'msg': '请输入正确的电话号码',
            });
            currentErrorMsg.push('请输入正确的电话号码');
        }
        if (this.isEmpty(obj.postalCode)) {
            errorMsg.push({
                'name': 'postalCode',
                'msg': '请输入邮政编码',
            });
            currentErrorMsg.push('请输入邮政编码');
        }
        // if(this.isEmpty(obj.trademarkUrl)) {
        //     errorMsg.push({
        //         'name': 'trademarkUrl',
        //         'msg':  '请上传商标注册证',
        //     });
        //     currentErrorMsg.push('请上传商标注册证');
        // }
        errorObj.errorMsg = errorMsg;
        errorObj.currentErrorMsg = currentErrorMsg;
        return errorObj;
    },
    validateTrademarkCertificate: function (obj) {
        var errorObj = {};
        var errorMsg = new Array();
        var currentErrorMsg = [];
        console.log(obj)
        if (this.isEmpty(obj.trademarkCode)) {
            errorMsg.push({
                'name': 'trademarkCode',
                'msg': '请输入商标注册号',
            });
            currentErrorMsg.push('请输入商标注册号');
        }
        if (this.isEmpty(obj.trademarkName)) {
            errorMsg.push({
                'name': 'trademarkName',
                'msg': '请输入商标名称',
            });
            currentErrorMsg.push('请输入商标名称');
        }
        if (this.isEmpty(obj.internationClassCode)) {
            errorMsg.push({
                'name': 'internationClassCode',
                'msg': '请输入国际分类',
            });
            currentErrorMsg.push('请输入国际分类');
        }
        // if(this.isEmpty(obj.trademarkKind)) {
        //     errorMsg.push({
        //         'name': 'trademarkKind',
        //         'msg':  '请选择商标种类',
        //     });
        //     currentErrorMsg.push('请选择商标种类');
        // }
        // if(this.isEmpty(obj.shareTrademark)) {
        //     errorMsg.push({
        //         'name': 'shareTrademark',
        //         'msg':  '请选择是否共有商标',
        //     });
        //     currentErrorMsg.push('请选择是否共有商标');
        // }
        //
        // if(this.isEmpty(obj.nationality)) {
        //     errorMsg.push({
        //         'name': 'nationality',
        //         'msg':  '请选择注册人国籍',
        //     });
        //     currentErrorMsg.push('请选择注册人国籍');
        // }
        //
        // if(this.isEmpty(obj.proposerType)) {
        //     errorMsg.push({
        //         'name': 'proposerType',
        //         'msg':  '请选择注册人类型',
        //     });
        //     currentErrorMsg.push('请选择注册人类型');
        // }
        // if(this.isEmpty(obj.causeDescript)) {
        //     errorMsg.push({
        //         'name': 'causeDescript',
        //         'msg':  '请输入补证原因',
        //     });
        //     currentErrorMsg.push('请输入补证原因');
        // }
        if (this.isEmpty(obj.contactName)) {
            errorMsg.push({
                'name': 'contactName',
                'msg': '请输入联系人姓名',
            });
            currentErrorMsg.push('请输入联系人姓名');
        }
        if (this.isEmpty(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhone',
                'msg': '请输入联系人电话',
            });
            currentErrorMsg.push('请输入联系人电话');
        }
        if (!this.isPhoneNumber(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhoneFormat',
                'msg': '请输入正确的电话号码',
            });
            currentErrorMsg.push('请输入正确的电话号码');
        }
        if (this.isEmpty(obj.postalCode)) {
            errorMsg.push({
                'name': 'postalCode',
                'msg': '请输入邮政编码',
            });
            currentErrorMsg.push('请输入邮政编码');
        }
        // if (this.isEmpty(obj.trademarkUrl)) {
        //     errorMsg.push({
        //         'name': 'trademarkUrl',
        //         'msg': '请上传商标注册证',
        //     });
        //     currentErrorMsg.push('请上传商标注册证');
        // }
        errorObj.errorMsg = errorMsg;
        errorObj.currentErrorMsg = currentErrorMsg;
        return errorObj;
    },
    validateTrademarkExtend: function (obj) {
        var errorObj = {};
        var errorMsg = new Array();
        var currentErrorMsg = [];
        console.log(obj)
        if (this.isEmpty(obj.trademarkCode)) {
            errorMsg.push({
                'name': 'trademarkCode',
                'msg': '请输入商标注册号',
            });
            currentErrorMsg.push('请输入商标注册号');
        }

        if (this.isEmpty(obj.trademarkName)) {
            errorMsg.push({
                'name': 'trademarkName',
                'msg': '请输入商标名称',
            });
            currentErrorMsg.push('请输入商标名称');
        }
        if (this.isEmpty(obj.internationClassCode)) {
            errorMsg.push({
                'name': 'internationClassCode',
                'msg': '请输入国际分类',
            });
            currentErrorMsg.push('请输入国际分类');
        }
        // if(this.isEmpty(obj.trademarkKind)) {
        //     errorMsg.push({
        //         'name': 'trademarkKind',
        //         'msg':  '请选择商标种类',
        //     });
        //     currentErrorMsg.push('请选择商标种类');
        // }
        // if(this.isEmpty(obj.bussnessType)) {
        //     errorMsg.push({
        //         'name': 'bussnessType',
        //         'msg':  '请选择业务类型',
        //     });
        //     currentErrorMsg.push('请选择业务类型');
        // }
        // if(this.isEmpty(obj.shareTrademark)) {
        //     errorMsg.push({
        //         'name': 'shareTrademark',
        //         'msg':  '请选择是否共有商标',
        //     });
        //     currentErrorMsg.push('请选择是否共有商标');
        // }
        //
        // if(this.isEmpty(obj.nationality)) {
        //     errorMsg.push({
        //         'name': 'nationality',
        //         'msg':  '请选择注册人国籍',
        //     });
        //     currentErrorMsg.push('请选择注册人国籍');
        // }
        //
        // if(this.isEmpty(obj.proposerType)) {
        //     errorMsg.push({
        //         'name': 'proposerType',
        //         'msg':  '请选择注册人类型',
        //     });
        //     currentErrorMsg.push('请选择注册人类型');
        // }
        if (this.isEmpty(obj.contactName)) {
            errorMsg.push({
                'name': 'contactName',
                'msg': '请输入联系人姓名',
            });
            currentErrorMsg.push('请输入联系人姓名');
        }
        if (this.isEmpty(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhone',
                'msg': '请输入联系人电话',
            });
            currentErrorMsg.push('请输入联系人电话');
        }
        if (!this.isPhoneNumber(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhoneFormat',
                'msg': '请输入正确的电话号码',
            });
            currentErrorMsg.push('请输入正确的电话号码');
        }
        if (this.isEmpty(obj.postalCode)) {
            errorMsg.push({
                'name': 'postalCode',
                'msg': '请输入邮政编码',
            });
            currentErrorMsg.push('请输入邮政编码');
        }
        // if(this.isEmpty(obj.trademarkUrl)) {
        //     errorMsg.push({
        //         'name': 'trademarkUrl',
        //         'msg':  '请上传商标注册证',
        //     });
        //     currentErrorMsg.push('请上传商标注册证');
        // }
        errorObj.errorMsg = errorMsg;
        errorObj.currentErrorMsg = currentErrorMsg;
        return errorObj;
    },
    validateTrademarkTransfer: function (obj) {
        var errorObj = {};
        var errorMsg = new Array();
        var currentErrorMsg = [];
        console.log(obj)
        if (this.isEmpty(obj.trademarkCode)) {
            errorMsg.push({
                'name': 'trademarkCode',
                'msg': '请输入商标注册号',
            });
            currentErrorMsg.push('请输入商标注册号');
        }
        if (this.isEmpty(obj.trademarkName)) {
            errorMsg.push({
                'name': 'trademarkName',
                'msg': '请输入商标名称',
            });
            currentErrorMsg.push('请输入商标名称');
        }
        if (this.isEmpty(obj.internationClassCode)) {
            errorMsg.push({
                'name': 'internationClassCode',
                'msg': '请输入国际分类',
            });
            currentErrorMsg.push('请输入国际分类');
        }
        // if(this.isEmpty(obj.trademarkKind)) {
        //     errorMsg.push({
        //         'name': 'trademarkKind',
        //         'msg':  '请选择商标种类',
        //     });
        //     currentErrorMsg.push('请选择商标种类');
        // }
        // if(this.isEmpty(obj.shareTrademark)) {
        //     errorMsg.push({
        //         'name': 'shareTrademark',
        //         'msg':  '请选择是否共有商标',
        //     });
        //     currentErrorMsg.push('请选择是否共有商标');
        // }
        //
        // if(this.isEmpty(obj.nationality)) {
        //     errorMsg.push({
        //         'name': 'nationality',
        //         'msg':  '请选择注册人国籍',
        //     });
        //     currentErrorMsg.push('请选择注册人国籍');
        // }
        //
        // if(this.isEmpty(obj.proposerType)) {
        //     errorMsg.push({
        //         'name': 'proposerType',
        //         'msg':  '请选择注册人类型',
        //     });
        //     currentErrorMsg.push('请选择注册人类型');
        // }

        if (this.isEmpty(obj.contactList)) {
            errorMsg.push({
                'name': 'contactList',
                'msg': '请至少选择一个受让人',
            });
            currentErrorMsg.push('请至少选择一个受让人');
        }

        if (!this.isEmpty(obj.contactList) && obj.contactList.length > 0) {
            var contactListError = [];
            for (var i = 0; i < obj.contactList.length; i++) {
                var contact = obj.contactList[i];
                var contactError = {};
                contactError.error = [];
                // if (this.isEmpty(contact.nationality)) {
                //     contactError.error.push({
                //         'name': 'nationality',
                //         'msg':  '请选择注册人国籍',
                //     });
                //     currentErrorMsg.push('请选择注册人国籍');
                // }
                // if(this.isEmpty(contact.proposerType)) {
                //     contactError.error.push({
                //         'name': 'proposerType',
                //         'msg':  '请选择注册人类型',
                //     });
                //     currentErrorMsg.push('请选择注册人类型');
                // }
                if (this.isEmpty(contact.contactName)) {
                    contactError.error.push({
                        'name': 'contactName',
                        'msg': '请输入受让人名称',
                    });
                    currentErrorMsg.push('请输入受让人名称');
                }
                if (this.isEmpty(contact.address)) {
                    contactError.error.push({
                        'name': 'address',
                        'msg': '请选择受让人详细地址',
                    });
                    currentErrorMsg.push('请选择受让人详细地址');
                }
                // if(this.isEmpty(contact.certificateUrl)) {
                //     contactError.error.push({
                //         'name': 'certificateUrl',
                //         'msg':  '请上传受让证照',
                //     });
                //     currentErrorMsg.push('请上传受让证照');
                // }
                contactListError.push(contactError);
            }
            errorMsg.push({
                'name': 'contactList',
                'contactListError': contactListError,
                'msg': '',
            });
        }

        if (this.isEmpty(obj.contactName)) {
            errorMsg.push({
                'name': 'contactName',
                'msg': '请输入联系人姓名',
            });
            currentErrorMsg.push('请输入联系人姓名');
        }
        if (this.isEmpty(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhone',
                'msg': '请输入联系人电话',
            });
            currentErrorMsg.push('请输入联系人电话');
        }
        if (!this.isPhoneNumber(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhoneFormat',
                'msg': '请输入正确的电话号码',
            });
            currentErrorMsg.push('请输入正确的电话号码');
        }
        if (this.isEmpty(obj.postalCode)) {
            errorMsg.push({
                'name': 'postalCode',
                'msg': '请输入邮政编码',
            });
            currentErrorMsg.push('请输入邮政编码');
        }
        // if(this.isEmpty(obj.trademarkUrl)) {
        //     errorMsg.push({
        //         'name': 'trademarkUrl',
        //         'msg':  '请上传商标注册证',
        //     });
        //     currentErrorMsg.push('请上传商标注册证');
        // }
        errorObj.errorMsg = errorMsg;
        errorObj.currentErrorMsg = currentErrorMsg;
        return errorObj;
    },
    validateTrademarkChange: function (obj) {
        var errorObj = {};
        var errorMsg = new Array();
        var currentErrorMsg = [];
        console.log(obj)
        if (this.isEmpty(obj.trademarkCode)) {
            errorMsg.push({
                'name': 'trademarkCode',
                'msg': '请输入商标注册号',
            });
            currentErrorMsg.push('请输入商标注册号');
        }
        if (this.isEmpty(obj.trademarkName)) {
            errorMsg.push({
                'name': 'trademarkName',
                'msg': '请输入商标名称',
            });
            currentErrorMsg.push('请输入商标名称');
        }
        if (this.isEmpty(obj.internationClassCode)) {
            errorMsg.push({
                'name': 'internationClassCode',
                'msg': '请输入国际分类',
            });
            currentErrorMsg.push('请输入国际分类');
        }

        if (obj.changeType == 0) {
            // 变更注册人
            if (!this.isEmpty(obj.registerList) && obj.registerList.length > 0) {
                var registertListError = [];
                for (var i = 0; i < obj.registerList.length; i++) {
                    var register = obj.registerList[i];
                    var registerError = {};
                    registerError.error = [];
                    if (this.isEmpty(register.namePre)) {
                        registerError.error.push({
                            'name': 'namePre',
                            'msg': '请输入变更前名称',
                        });
                        currentErrorMsg.push('请输入变更前名称');
                    }
                    if (this.isEmpty(register.nameAfter)) {
                        registerError.error.push({
                            'name': 'nameAfter',
                            'msg': '请输入变更后名称',
                        });
                        currentErrorMsg.push('请输入变更后名称');
                    }

                    if (this.isEmpty(register.provinceCodePre) || this.isEmpty(register.cityCodePre) || this.isEmpty(register.countyPre) || this.isEmpty(register.addressPre)) {
                        registerError.error.push({
                            'name': 'addressPre',
                            'msg': '请输入变更前地址',
                        });
                        currentErrorMsg.push('请输入变更前地址');
                    }
                    if (this.isEmpty(register.provinceCodeAfter) || this.isEmpty(register.cityCodeAfter) || this.isEmpty(register.countyAfter) || this.isEmpty(register.addressAfter)) {
                        registerError.error.push({
                            'name': 'addressAfter',
                            'msg': '请输入变更后地址',
                        });
                        currentErrorMsg.push('请输入变更后地址');
                    }
                    registertListError.push(registerError);
                }
                errorMsg.push({
                    'name': 'registertList',
                    'registertListError': registertListError,
                    'msg': '',
                });
            }
        } else if (obj.changeType == 1) {
            // 变更代理
            if (!this.isEmpty(obj.proxyer)) {
                var proxyer = obj.proxyer;
                var proxyerError = [];
                if (this.isEmpty(proxyer.namePre)) {
                    proxyerError.push({
                        'name': 'namePre',
                        'msg': '请输入变更前代理人名称',
                    });
                    currentErrorMsg.push('请输入变更前代理人名称');
                }
                if (this.isEmpty(proxyer.provinceCodePre) || this.isEmpty(proxyer.cityCodePre) || this.isEmpty(proxyer.countyPre) || this.isEmpty(proxyer.addressPre)) {
                    proxyerError.push({
                        'name': 'addressPre',
                        'msg': '请输入变更前地址',
                    });
                    currentErrorMsg.push('请输入变更前地址');
                }
                if (this.isEmpty(proxyer.fileReceiverPre)) {
                    proxyerError.push({
                        'name': 'fileReceiverPre',
                        'msg': '请输入变更前文件接收人',
                    });
                    currentErrorMsg.push('请输入变更前文件接收人');
                }
                if (this.isEmpty(proxyer.postalCodePre)) {
                    proxyerError.push({
                        'name': 'postalCodePre',
                        'msg': '请输入变更前邮编',
                    });
                    currentErrorMsg.push('请输入变更前邮编');
                }
                if (this.isEmpty(proxyer.nameAfter)) {
                    proxyerError.push({
                        'name': 'nameAfter',
                        'msg': '请输入变更后代理人名称',
                    });
                    currentErrorMsg.push('请输入变更后代理人名称');
                }
                if (this.isEmpty(proxyer.provinceCodeAfter) || this.isEmpty(proxyer.cityCodeAfter) || this.isEmpty(proxyer.countyAfter) || this.isEmpty(proxyer.addressAfter)) {
                    proxyerError.push({
                        'name': 'addressAfter',
                        'msg': '请输入变更后地址',
                    });
                    currentErrorMsg.push('请输入变更后地址');
                }
                if (this.isEmpty(proxyer.fileReceiverAfter)) {
                    proxyerError.push({
                        'name': 'fileReceiverAfter',
                        'msg': '请输入变更后文件接收人',
                    });
                    currentErrorMsg.push('请输入变更后文件接收人');
                }
                if (this.isEmpty(proxyer.postalCodeAfter)) {
                    proxyerError.push({
                        'name': 'postalCodeAfter',
                        'msg': '请输入变更后邮编',
                    });
                    currentErrorMsg.push('请输入变更后邮编');
                }
                errorMsg.push({
                    'name': 'proxyer',
                    'msg': '请完善代理人信息',
                    'changeProxyerError': proxyerError,
                });
            }

        } else if (obj.changeType == 2) {
            // 变更许可
            if (!this.isEmpty(obj.licencer)) {
                var licencer = obj.licencer;
                var licencerError = [];
                if (this.isEmpty(licencer.recordCode)) {
                    licencerError.push({
                        'name': 'recordCode',
                        'msg': '请输入许可备案号',
                    });
                    currentErrorMsg.push('请输入许可备案号');
                }
                if (this.isEmpty(licencer.licensorName)) {
                    licencerError.push({
                        'name': 'licensorName',
                        'msg': '请输入许可人名称',
                    });
                    currentErrorMsg.push('请输入许可人名称');
                }
                if (this.isEmpty(licencer.asLicensorName)) {
                    licencerError.push({
                        'name': 'asLicensorName',
                        'msg': '请输入变更人名称',
                    });
                    currentErrorMsg.push('请输入变更人名称');
                }
                // if (this.isEmpty(licencer.certificateUrl)) {
                //     licencerError.push({
                //         'name': 'certificateUrl',
                //         'msg': '请上传证件照',
                //     });
                //     currentErrorMsg.push('请上传证件照');
                // }
                // if (this.isEmpty(licencer.alterProveUrl)) {
                //     licencerError.push({
                //         'name': 'alterProveUrl',
                //         'msg': '请上传工商变更证明',
                //     });
                //     currentErrorMsg.push('请上传工商变更证明');
                // }
            }
            errorMsg.push({
                'name': 'licencer',
                'msg': '请完善许可人信息',
                'changeLicencerError': licencerError,
            });
        }
        if (this.isEmpty(obj.contactName)) {
            errorMsg.push({
                'name': 'contactName',
                'msg': '请输入联系人姓名',
            });
            currentErrorMsg.push('请输入联系人姓名');
        }
        if (this.isEmpty(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhone',
                'msg': '请输入联系人电话',
            });
            currentErrorMsg.push('请输入联系人电话');
        }
        if (!this.isPhoneNumber(obj.contactPhone)) {
            errorMsg.push({
                'name': 'contactPhoneFormat',
                'msg': '请输入正确的电话号码',
            });
            currentErrorMsg.push('请输入正确的电话号码');
        }
        if (this.isEmpty(obj.postalCode)) {
            errorMsg.push({
                'name': 'postalCode',
                'msg': '请输入邮政编码',
            });
            currentErrorMsg.push('请输入邮政编码');
        }
        errorObj.errorMsg = errorMsg;
        errorObj.currentErrorMsg = currentErrorMsg;
        return errorObj;
    },
    // 显示表单错误
    displayFormErrors: function (formSelector, errorList) {
        $('.form_error').remove();
        $('*').removeClass('error');
        var canSubmit = true;
        console.log(errorList)
        for (var i = 0; i < errorList.length; i++) {
            var formError = errorList[i];
            if (formError.error && formError.error.errorMsg.length > 0) {
                for (var j = 0; j < formError.error.errorMsg.length; j++) {
                    var selector;
                    var displayType = 'red-border';
                    if (formError.error.errorMsg[j].name.endsWith('Format')) {
                        selector = '[name=' + formError.error.errorMsg[j].name.substr(0, formError.error.errorMsg[j].name.length - 6) + ']';
                        displayType = 'tips';
                        canSubmit = false;
                    } else if (formError.error.errorMsg[j].name.endsWith('List')) {
                        if (formError.error.errorMsg[j].hasOwnProperty('contactListError')) {
                            var contactListError = formError.error.errorMsg[j].contactListError;
                            for (var k = 0; k < contactListError.length; k++) {
                                var subSelector = '';
                                var subDisplayType = '';
                                for (var x = 0; x < contactListError[k].error.length; x++) {
                                    subSelector = '[name=' + contactListError[k].error[x].name + ']';
                                    if (contactListError[k].error.length > 0) {
                                        canSubmit = false;
                                    }
                                    if (contactListError[k].error[x].name == 'address') {
                                        subDisplayType = 'address';
                                        subSelector = '[name=address]';
                                    } else if (contactListError[k].error[x].name.endsWith('Url')) {
                                        subDisplayType = 'url';
                                        subSelector = '[name=' + contactListError[k].error[x].name + ']';
                                    } else {
                                        subSelector = '[name=' + contactListError[k].error[x].name + ']';
                                    }
                                    if ($('.trademark_transfer_form_child').eq(k).find(subSelector).attr('type') == 'radio') {
                                        subDisplayType = 'radio';
                                    }
                                    var subInput = $(formSelector).eq(i).siblings('.trademark_transfer_form_child').find('.contact_form_content').eq(k).find(subSelector);
                                    subInput.parents('.field').addClass('error');
                                    subInput.focus(function(){
                                        $(this).parents('.field').removeClass('error');
                                    });
                                }
                            }
                        }

                        if (formError.error.errorMsg[j].hasOwnProperty('registertListError')) {
                            var registertListError = formError.error.errorMsg[j].registertListError;
                            for (var k = 0; k < registertListError.length; k++) {
                                var subSelector = '';
                                var subDisplayType = '';
                                for (var x = 0; x < registertListError[k].error.length; x++) {
                                    if (registertListError[k].error.length > 0) {
                                        canSubmit = false;
                                    }
                                    subSelector = '[name=' + registertListError[k].error[x].name + ']';
                                    if (registertListError[k].error[x].name == 'address') {
                                        subDisplayType = 'address';
                                        subSelector = '[name=address]';
                                    } else if (registertListError[k].error[x].name.endsWith('Url')) {
                                        subDisplayType = 'url';
                                        subSelector = '[name=' + registertListError[k].error[x].name + ']';
                                    } else {
                                        subSelector = '[name=' + registertListError[k].error[x].name + ']';
                                    }
                                    if ($('.trademark_change_form_child').eq(k).find(subSelector).attr('type') == 'radio') {
                                        subDisplayType = 'radio';
                                    }
                                    var subInput = $(formSelector).eq(i).siblings('.trademark_change_form_child').find('.register_form_content').eq(k).find(subSelector);
                                    subInput.parents('.field').addClass('error');
                                    subInput.focus(function(){
                                        $(this).parents('.field').removeClass('error');
                                    });
                                }
                            }
                        }

                    } else if (formError.error.errorMsg[j].hasOwnProperty('changeProxyerError')) {
                        var proxyerError = formError.error.errorMsg[j].changeProxyerError;
                        if (proxyerError.length > 0) {
                            canSubmit = false;
                        }
                        for (var k = 0; k < proxyerError.length; k++) {
                            var subSelector = '';
                            var subDisplayType = '';
                            subSelector = '[name=' + proxyerError[k].name + ']';
                            var subInput = $(formSelector).eq(i).siblings('.trademark_change_form_child').find(subSelector);
                            subInput.parents('.field').addClass('error');
                            subInput.focus(function(){
                                $(this).parents('.field').removeClass('error');
                            });
                        }
                    } else if (formError.error.errorMsg[j].hasOwnProperty('changeLicencerError')) {
                        var licencerError = formError.error.errorMsg[j].changeLicencerError;
                        if (licencerError.length > 0) {
                            canSubmit = false;
                        }
                        for (var k = 0; k < licencerError.length; k++) {
                            var subSelector = '';
                            var subDisplayType = '';
                            if (licencerError[k].name.endsWith('Url')) {
                                subDisplayType = 'url';
                            }
                            subSelector = '[name=' + licencerError[i].name + ']';
                            var subInput =  $(formSelector).eq(i).siblings('.trademark_change_form_child').find(subSelector);
                            subInput.parents('.field').addClass('error');
                            subInput.focus(function(){
                                $(this).parents('.field').removeClass('error');
                            });
                        }
                    } else if (formError.error.errorMsg[j].hasOwnProperty('proxyerError')) {
                        var proxyerError = formError.error.errorMsg[j].proxyerError;
                        if (proxyerError.length > 0) {
                            canSubmit = false;
                        }
                        for (var k = 0; k < proxyerError.length; k++) {
                            var subSelector = '';
                            var subDisplayType = '';
                            subSelector = '[name=' + proxyerError[k].name + ']';
                            var subInput =  $(formSelector).eq(i).siblings('.trademark_change_form_child').find(subSelector);
                            subInput.parents('.field').addClass('error');
                            subInput.focus(function(){
                                $(this).parents('.field').removeClass('error');
                            });
                        }
                    } else if (formError.error.errorMsg[j].hasOwnProperty('licencerError')) {
                        var licencerError = formError.error.errorMsg[j].licencerError;
                        if (licencerError.length > 0) {
                            canSubmit = false;
                        }
                        for (var k = 0; k < licencerError.length; k++) {
                            var subSelector = '';
                            var subDisplayType = '';
                            if (licencerError[k].name.endsWith('Url')) {
                                subDisplayType = 'url';
                            }
                            subSelector = '[name=' + licencerError[k].name + ']';
                            var subInput = $(formSelector).find(subSelector);
                            subInput.parents('.field').addClass('error');
                            subInput.focus(function(){
                                $(this).parents('.field').removeClass('error');
                            });
                        }
                    } else if (formError.error.errorMsg[j].name == 'address') {
                        displayType = 'address';
                        selector = '[name=applyAddress]';
                        canSubmit = false;
                    } else if (formError.error.errorMsg[j].name == 'internationClassCode') {
                        displayType = 'internationClassCode';
                        selector = 'input[name=internationClassCode]';
                        canSubmit = false;
                    } else if (formError.error.errorMsg[j].name.endsWith('Url')) {
                        displayType = 'url';
                        selector = '[name=' + formError.error.errorMsg[j].name + ']';
                        canSubmit = false;
                    } else {
                        selector = '[name=' + formError.error.errorMsg[j].name + ']';
                        canSubmit = false;
                    }
                    var input = $(formSelector).eq(errorList[i].index).find(selector);
                    input.parents('.field').addClass('error');
                    input.focus(function(){
                        $(this).parents('.field').removeClass('error');
                    });
                }
            }
        }
        return canSubmit;
    },
    isEmpty: function (any) {
        if (any && any != '') {
            return false;
        } else {
            return true;
        }
    },
    isPhoneNumber: function (phone) {
        var myreg = /^1[34578]\d{9}$/;
        return myreg.test(phone);
    },
    canSubmit: function () {

    },
};